-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfix_paths.py
More file actions
36 lines (34 loc) · 1004 Bytes
/
fix_paths.py
File metadata and controls
36 lines (34 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import os, re
files = [
"openclaw-mgr/cmd/logs.sh",
"openclaw-mgr/cmd/uninstall.sh",
"openclaw-mgr/cmd/restore.sh",
"openclaw-mgr/cmd/backup.sh",
"openclaw-mgr/cmd/update.sh",
"openclaw-mgr/cmd/stop.sh",
"openclaw-mgr/cmd/start.sh",
"openclaw-mgr/lib/detect.sh",
]
for fpath in files:
if not os.path.exists(fpath):
print(f"SKIP: {fpath}")
continue
with open(fpath, encoding="utf-8") as f:
content = f.read()
orig = content
# Fix OPENCLAW_DIR default
content = content.replace(
'OPENCLAW_DIR:-$HOME/openclaw}',
'OPENCLAW_DIR:-$HOME/DEV/openclaw}'
)
# Also fix local dir references in detect.sh
content = content.replace(
'OPENCLAW_DIR:-$HOME/openclaw"',
'OPENCLAW_DIR:-$HOME/DEV/openclaw"'
)
if content != orig:
with open(fpath, "w", encoding="utf-8") as f:
f.write(content)
print(f"Fixed: {fpath}")
else:
print(f"No change: {fpath}")