File tree Expand file tree Collapse file tree
src/core/templates-entrypoint Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -271,14 +271,18 @@ cd "$REPO_ROOT"
271271if [ "${ "${" } DOCKER_GIT_SKIP_SESSION_BACKUP:-}" != "1" ]; then
272272 if command -v gh >/dev/null 2>&1; then
273273 BACKUP_SCRIPT=""
274- if [ -f /opt/docker-git/scripts/session-backup-gist.js ]; then
275- BACKUP_SCRIPT="/opt/docker-git/scripts/session-backup-gist.js"
276- elif [ -f "$REPO_ROOT/scripts/session-backup-gist.js" ]; then
274+ if [ -f "$REPO_ROOT/scripts/session-backup-gist.js" ]; then
277275 BACKUP_SCRIPT="$REPO_ROOT/scripts/session-backup-gist.js"
276+ elif [ -f /opt/docker-git/scripts/session-backup-gist.js ]; then
277+ BACKUP_SCRIPT="/opt/docker-git/scripts/session-backup-gist.js"
278278 fi
279279 if [ -n "$BACKUP_SCRIPT" ]; then
280280 node "$BACKUP_SCRIPT" || echo "[session-backup] Warning: session backup failed (non-fatal)"
281+ else
282+ echo "[session-backup] Warning: script not found (expected repo or global path)"
281283 fi
284+ else
285+ echo "[session-backup] Warning: gh CLI not found (skipping session backup)"
282286 fi
283287fi
284288EOF
Original file line number Diff line number Diff line change @@ -60,6 +60,10 @@ describe("renderEntrypointGitHooks", () => {
6060 expect ( hooks ) . toContain ( "Run session backup after successful push" )
6161 expect ( hooks ) . toContain ( "node \"$BACKUP_SCRIPT\"" )
6262 expect ( hooks ) . not . toContain ( "node \"$BACKUP_SCRIPT\" --verbose" )
63+ expect ( hooks . indexOf ( '$REPO_ROOT/scripts/session-backup-gist.js' ) ) . toBeLessThan (
64+ hooks . indexOf ( "/opt/docker-git/scripts/session-backup-gist.js" )
65+ )
66+ expect ( hooks ) . toContain ( "[session-backup] Warning: gh CLI not found" )
6367 } )
6468} )
6569
You can’t perform that action at this time.
0 commit comments