gitarsenal-cli 1.5.5 → 1.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/install.sh +0 -30
- package/python/modal_logs_patch.py +0 -86
package/package.json
CHANGED
package/install.sh
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
|
3
|
-
# GitArsenal CLI Installation Script
|
4
|
-
|
5
|
-
echo "🚀 Installing GitArsenal CLI..."
|
6
|
-
|
7
|
-
# Check if npm is installed
|
8
|
-
if ! command -v npm &> /dev/null; then
|
9
|
-
echo "❌ npm is not installed. Please install Node.js and npm first."
|
10
|
-
exit 1
|
11
|
-
fi
|
12
|
-
|
13
|
-
# Check if Python is installed
|
14
|
-
if ! command -v python &> /dev/null && ! command -v python3 &> /dev/null; then
|
15
|
-
echo "❌ Python is not installed. Please install Python 3.8 or higher."
|
16
|
-
exit 1
|
17
|
-
fi
|
18
|
-
|
19
|
-
# Check if Modal is installed
|
20
|
-
if ! command -v modal &> /dev/null; then
|
21
|
-
echo "⚠️ Modal CLI not found. Installing modal-client..."
|
22
|
-
pip install modal || python3 -m pip install modal
|
23
|
-
fi
|
24
|
-
|
25
|
-
# Install the package globally
|
26
|
-
echo "📦 Installing GitArsenal CLI globally..."
|
27
|
-
npm install -g .
|
28
|
-
|
29
|
-
echo "✅ Installation complete!"
|
30
|
-
echo "You can now run the CLI tool with: gitarsenal"
|
@@ -1,86 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python3
|
2
|
-
"""
|
3
|
-
This script patches the test_modalSandboxScript.py file to replace "modal" with "container" in the logs.
|
4
|
-
"""
|
5
|
-
|
6
|
-
import os
|
7
|
-
import re
|
8
|
-
import sys
|
9
|
-
import shutil
|
10
|
-
from pathlib import Path
|
11
|
-
|
12
|
-
def patch_modal_logs(script_path):
|
13
|
-
"""
|
14
|
-
Patch the Python script to replace "modal" with "container" in the logs.
|
15
|
-
"""
|
16
|
-
print(f"Patching {script_path} to replace 'modal' with 'container' in logs...")
|
17
|
-
|
18
|
-
# Make a backup of the original file
|
19
|
-
backup_path = f"{script_path}.bak"
|
20
|
-
shutil.copy2(script_path, backup_path)
|
21
|
-
|
22
|
-
# Read the file
|
23
|
-
with open(script_path, 'r', encoding='utf-8') as f:
|
24
|
-
content = f.read()
|
25
|
-
|
26
|
-
# Define replacements
|
27
|
-
replacements = [
|
28
|
-
# Function names
|
29
|
-
(r'def create_modal_sandbox', r'def create_container'),
|
30
|
-
(r'def create_modal_ssh_container', r'def create_ssh_container'),
|
31
|
-
|
32
|
-
# Log messages - case sensitive replacements
|
33
|
-
(r'Modal sandbox', r'Container'),
|
34
|
-
(r'Modal authentication', r'Container authentication'),
|
35
|
-
(r'Modal token', r'Container token'),
|
36
|
-
(r'Modal package', r'Container package'),
|
37
|
-
(r'Modal operations', r'Container operations'),
|
38
|
-
|
39
|
-
# Log messages - case insensitive replacements (lowercase)
|
40
|
-
(r'modal sandbox', r'container'),
|
41
|
-
(r'modal authentication', r'container authentication'),
|
42
|
-
(r'modal token', r'container token'),
|
43
|
-
(r'modal package', r'container package'),
|
44
|
-
(r'modal operations', r'container operations'),
|
45
|
-
|
46
|
-
# Keep function calls to modal library intact but change logs
|
47
|
-
(r'print\([\'"](.*)modal(.*)[\'"]', r'print(\1container\2'),
|
48
|
-
(r'log\([\'"](.*)modal(.*)[\'"]', r'log(\1container\2'),
|
49
|
-
(r'logger\.info\([\'"](.*)modal(.*)[\'"]', r'logger.info(\1container\2'),
|
50
|
-
(r'logger\.error\([\'"](.*)modal(.*)[\'"]', r'logger.error(\1container\2'),
|
51
|
-
(r'logger\.warning\([\'"](.*)modal(.*)[\'"]', r'logger.warning(\1container\2'),
|
52
|
-
(r'logger\.debug\([\'"](.*)modal(.*)[\'"]', r'logger.debug(\1container\2'),
|
53
|
-
]
|
54
|
-
|
55
|
-
# Apply replacements
|
56
|
-
for pattern, replacement in replacements:
|
57
|
-
content = re.sub(pattern, replacement, content, flags=re.IGNORECASE)
|
58
|
-
|
59
|
-
# Write the modified content back to the file
|
60
|
-
with open(script_path, 'w', encoding='utf-8') as f:
|
61
|
-
f.write(content)
|
62
|
-
|
63
|
-
print(f"Patching complete. Original file backed up to {backup_path}")
|
64
|
-
return True
|
65
|
-
|
66
|
-
def main():
|
67
|
-
"""
|
68
|
-
Main entry point for the script.
|
69
|
-
"""
|
70
|
-
# Get the path to the script
|
71
|
-
script_dir = Path(__file__).parent
|
72
|
-
script_path = script_dir / "test_modalSandboxScript.py"
|
73
|
-
|
74
|
-
if not script_path.exists():
|
75
|
-
print(f"Error: Script not found at {script_path}")
|
76
|
-
return 1
|
77
|
-
|
78
|
-
try:
|
79
|
-
patch_modal_logs(script_path)
|
80
|
-
return 0
|
81
|
-
except Exception as e:
|
82
|
-
print(f"Error patching file: {e}")
|
83
|
-
return 1
|
84
|
-
|
85
|
-
if __name__ == "__main__":
|
86
|
-
sys.exit(main())
|