tao-shen commited on
Commit
f18a4b6
·
verified ·
1 Parent(s): 8b27af4

Upload scripts/sync_hf.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. scripts/sync_hf.py +15 -6
scripts/sync_hf.py CHANGED
@@ -600,16 +600,25 @@ class OpenClawFullSync:
600
  print(f"[SYNC] ERROR: App directory does not exist: {APP_DIR}")
601
  return None
602
 
603
- # Debug: check if dist/entry.js exists
604
  entry_js = Path(APP_DIR) / "dist" / "entry.js"
605
- if not entry_js.exists():
606
- print(f"[SYNC] ERROR: dist/entry.js not found in {APP_DIR}")
 
 
 
 
 
 
 
 
 
 
607
  return None
608
 
609
  # Use subprocess.run with direct output, no shell pipe
610
- print(f"[SYNC] Launching: node dist/entry.js gateway")
611
  print(f"[SYNC] Working directory: {APP_DIR}")
612
- print(f"[SYNC] Entry point exists: {entry_js}")
613
  print(f"[SYNC] Log file: {log_file}")
614
 
615
  # Open log file
@@ -649,7 +658,7 @@ class OpenClawFullSync:
649
  # Use Popen without shell to avoid pipe issues
650
  # auth disabled in config — no token needed
651
  process = subprocess.Popen(
652
- ["node", "dist/entry.js", "gateway"],
653
  cwd=str(APP_DIR),
654
  stdout=subprocess.PIPE, # Capture so we can log it
655
  stderr=subprocess.STDOUT,
 
600
  print(f"[SYNC] ERROR: App directory does not exist: {APP_DIR}")
601
  return None
602
 
603
+ # Debug: check entry point (dist/entry.js or openclaw.mjs)
604
  entry_js = Path(APP_DIR) / "dist" / "entry.js"
605
+ openclaw_mjs = Path(APP_DIR) / "openclaw.mjs"
606
+ if entry_js.exists():
607
+ entry_cmd = ["node", "dist/entry.js", "gateway"]
608
+ elif openclaw_mjs.exists():
609
+ entry_cmd = ["node", "openclaw.mjs", "gateway", "--allow-unconfigured"]
610
+ else:
611
+ print(f"[SYNC] ERROR: No entry point found in {APP_DIR}")
612
+ print(f"[SYNC] Checked: dist/entry.js, openclaw.mjs")
613
+ # List what's actually there
614
+ try:
615
+ print(f"[SYNC] Contents: {list(Path(APP_DIR).iterdir())[:20]}")
616
+ except: pass
617
  return None
618
 
619
  # Use subprocess.run with direct output, no shell pipe
620
+ print(f"[SYNC] Launching: {' '.join(entry_cmd)}")
621
  print(f"[SYNC] Working directory: {APP_DIR}")
 
622
  print(f"[SYNC] Log file: {log_file}")
623
 
624
  # Open log file
 
658
  # Use Popen without shell to avoid pipe issues
659
  # auth disabled in config — no token needed
660
  process = subprocess.Popen(
661
+ entry_cmd,
662
  cwd=str(APP_DIR),
663
  stdout=subprocess.PIPE, # Capture so we can log it
664
  stderr=subprocess.STDOUT,