diff --git a/deploy/auto-deploy.sh b/deploy/auto-deploy.sh index 0b0dac7..00352ca 100755 --- a/deploy/auto-deploy.sh +++ b/deploy/auto-deploy.sh @@ -51,7 +51,7 @@ fi # Syntax check all Python files before copying ERRORS=0 -for f in lib/*.py *.py diagnostics/*.py telegram/*.py; do +for f in lib/*.py *.py diagnostics/*.py telegram/*.py tests/*.py; do [ -f "$f" ] || continue if ! python3 -c "import ast, sys; ast.parse(open(sys.argv[1]).read())" "$f" 2>&1; then log "SYNTAX ERROR: $f" @@ -65,18 +65,19 @@ fi log "Syntax check passed" # Sync to working directories -RSYNC_FLAGS="-az --exclude='__pycache__' --exclude='*.pyc' --exclude='*.bak*'" +RSYNC_OPTS=(-az --exclude __pycache__ --exclude '*.pyc' --exclude '*.bak*') -rsync $RSYNC_FLAGS lib/ "$PIPELINE_DIR/lib/" +rsync "${RSYNC_OPTS[@]}" lib/ "$PIPELINE_DIR/lib/" for f in teleo-pipeline.py reweave.py fetch_coins.py; do - [ -f "$f" ] && rsync $RSYNC_FLAGS "$f" "$PIPELINE_DIR/$f" + [ -f "$f" ] && rsync "${RSYNC_OPTS[@]}" "$f" "$PIPELINE_DIR/$f" done -rsync $RSYNC_FLAGS telegram/ "$PIPELINE_DIR/telegram/" -rsync $RSYNC_FLAGS diagnostics/ "$DIAGNOSTICS_DIR/" -rsync $RSYNC_FLAGS agent-state/ "$AGENT_STATE_DIR/" -[ -f research/research-session.sh ] && rsync $RSYNC_FLAGS research/research-session.sh /opt/teleo-eval/research-session.sh +rsync "${RSYNC_OPTS[@]}" telegram/ "$PIPELINE_DIR/telegram/" +rsync "${RSYNC_OPTS[@]}" diagnostics/ "$DIAGNOSTICS_DIR/" +rsync "${RSYNC_OPTS[@]}" agent-state/ "$AGENT_STATE_DIR/" +rsync "${RSYNC_OPTS[@]}" tests/ "$PIPELINE_DIR/tests/" +[ -f research/research-session.sh ] && rsync "${RSYNC_OPTS[@]}" research/research-session.sh /opt/teleo-eval/research-session.sh # Safety net: ensure all .sh files are executable after rsync find /opt/teleo-eval -maxdepth 3 -name '*.sh' -not -perm -u+x -exec chmod +x {} +