File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ async function createTempGitRepoWithInitHook(options: {
6666
6767 let scriptContent : string ;
6868 if ( options . customScript ) {
69- scriptContent = `#!/usr/ bin/env bash\n${ options . customScript } \nexit ${ options . exitCode } \n` ;
69+ scriptContent = `#!/bin/bash\n${ options . customScript } \nexit ${ options . exitCode } \n` ;
7070 } else {
7171 const sleepCmd = options . sleepBetweenLines ? `sleep ${ options . sleepBetweenLines / 1000 } ` : "" ;
7272
@@ -79,11 +79,14 @@ async function createTempGitRepoWithInitHook(options: {
7979
8080 const stderrCmds = ( options . stderrLines ?? [ ] ) . map ( ( line ) => `echo "${ line } " >&2` ) . join ( "\n" ) ;
8181
82- scriptContent = `#!/usr/ bin/env bash\n${ stdoutCmds } \n${ stderrCmds } \nexit ${ options . exitCode } \n` ;
82+ scriptContent = `#!/bin/bash\n${ stdoutCmds } \n${ stderrCmds } \nexit ${ options . exitCode } \n` ;
8383 }
8484
8585 await fs . writeFile ( hookPath , scriptContent , { mode : 0o755 } ) ;
8686
87+ // Commit the init hook (required for SSH runtime - git worktree syncs committed files)
88+ await execAsync ( `git add -A && git commit -m "Add init hook"` , { cwd : tempDir } ) ;
89+
8790 return tempDir ;
8891}
8992
You can’t perform that action at this time.
0 commit comments