Spaces:
Sleeping
Sleeping
Upload scripts/sync_hf.py with huggingface_hub
Browse files599 unmodified lines60060160260360460560660760860961061161261361461533 unmodified lines649650651652653654655599 unmodified linesprint(f"[SYNC] ERROR: App directory does not exist: {APP_DIR}")return None# Debug: check if dist/entry.js existsentry_js = Path(APP_DIR) / "dist" / "entry.js"if not entry_js.exists():print(f"[SYNC] ERROR: dist/entry.js not found in {APP_DIR}")return None# Use subprocess.run with direct output, no shell pipeprint(f"[SYNC] Launching: node dist/entry.js gateway")print(f"[SYNC] Working directory: {APP_DIR}")print(f"[SYNC] Entry point exists: {entry_js}")print(f"[SYNC] Log file: {log_file}")# Open log file33 unmodified lines# Use Popen without shell to avoid pipe issues# auth disabled in config — no token neededprocess = subprocess.Popen(["node", "dist/entry.js", "gateway"],cwd=str(APP_DIR),stdout=subprocess.PIPE, # Capture so we can log itstderr=subprocess.STDOUT,599 unmodified lines60060160260360460560660760860961061161261361461561661761861962062162262362433 unmodified lines658659660661662663664599 unmodified linesprint(f"[SYNC] ERROR: App directory does not exist: {APP_DIR}")return None# Debug: check entry point (dist/entry.js or openclaw.mjs)entry_js = Path(APP_DIR) / "dist" / "entry.js"openclaw_mjs = Path(APP_DIR) / "openclaw.mjs"if entry_js.exists():entry_cmd = ["node", "dist/entry.js", "gateway"]elif openclaw_mjs.exists():entry_cmd = ["node", "openclaw.mjs", "gateway", "--allow-unconfigured"]else:print(f"[SYNC] ERROR: No entry point found in {APP_DIR}")print(f"[SYNC] Checked: dist/entry.js, openclaw.mjs")# List what's actually theretry:print(f"[SYNC] Contents: {list(Path(APP_DIR).iterdir())[:20]}")except: passreturn None# Use subprocess.run with direct output, no shell pipeprint(f"[SYNC] Launching: {' '.join(entry_cmd)}")print(f"[SYNC] Working directory: {APP_DIR}")print(f"[SYNC] Log file: {log_file}")# Open log file33 unmodified lines# Use Popen without shell to avoid pipe issues# auth disabled in config — no token neededprocess = subprocess.Popen(entry_cmd,cwd=str(APP_DIR),stdout=subprocess.PIPE, # Capture so we can log itstderr=subprocess.STDOUT,
scripts/sync_hf.py+15-6