From 7050daefc65e68961f4c021b20be84c0e5476d67 Mon Sep 17 00:00:00 2001 From: Savil Srivastava <676452+savil@users.noreply.github.com> Date: Thu, 5 Oct 2023 10:52:00 -0700 Subject: [PATCH] [script set -e] enable feature flag --- internal/boxcli/featureflag/script_exit_on_error.go | 2 +- internal/shellgen/scripts.go | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/boxcli/featureflag/script_exit_on_error.go b/internal/boxcli/featureflag/script_exit_on_error.go index e5a562cb250..920d034e2fb 100644 --- a/internal/boxcli/featureflag/script_exit_on_error.go +++ b/internal/boxcli/featureflag/script_exit_on_error.go @@ -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") diff --git a/internal/shellgen/scripts.go b/internal/shellgen/scripts.go index b92bc58ee7b..2fdaa942b39 100644 --- a/internal/shellgen/scripts.go +++ b/internal/shellgen/scripts.go @@ -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)