Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/boxcli/featureflag/script_exit_on_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ package featureflag

// ScriptExitOnError controls whether scripts defined in devbox.json
// and executed via `devbox run` should exit if any command within them errors.
var ScriptExitOnError = disable("SCRIPT_EXIT_ON_ERROR")
var ScriptExitOnError = enable("SCRIPT_EXIT_ON_ERROR")
4 changes: 1 addition & 3 deletions internal/shellgen/scripts.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ func WriteScriptFile(devbox devboxer, name, body string) (err error) {
defer script.Close() // best effort: close file

if featureflag.ScriptExitOnError.Enabled() {
// NOTE: Devbox scripts will run using `sh` for consistency.
// However, we need to disable this for `fish` shell if/when we allow this for init_hooks,
// since init_hooks run in the host shell, and not `sh`.
// NOTE: Devbox scripts run using `sh` for consistency.
body = fmt.Sprintf("set -e\n\n%s", body)
}
_, err = script.WriteString(body)
Expand Down