diff --git a/internal/cli/run.go b/internal/cli/run.go index 3686b56fd7..b8331a53d2 100644 --- a/internal/cli/run.go +++ b/internal/cli/run.go @@ -651,6 +651,18 @@ func bootstrapEnv(sshConfigPath, sandboxName, repoDir string, h *harness.Harness return fmt.Errorf("copying host file %s to %s: %w", hf.Src, hf.Dest, err) } } + + // TODO(#345): remove this once admin install preserves the executable + // bit when writing files to .fullsend/. The GitHub Contents API commits + // everything as 100644, so scripts lose +x. Force it back for anything + // landing in a bin/ directory. + // https://github.com/fullsend-ai/fullsend/issues/345#issuecomment-4300740512 + if strings.Contains(hf.Dest, "/bin/") { + chmodCmd := fmt.Sprintf("chmod +x %s", hf.Dest) + if _, _, _, sshErr := sandbox.SSH(sshConfigPath, sandboxName, chmodCmd, 10*time.Second); sshErr != nil { + return fmt.Errorf("chmod host file %s in sandbox: %w", hf.Dest, sshErr) + } + } } return nil