diff --git a/.vscode/settings.json b/.vscode/settings.json index c9b36b48b..40853bbdb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -11,5 +11,5 @@ "eslint.workingDirectories": ["./web"], "prettier.configPath": "./web/.prettierrc.js", "prettier.ignorePath": "./web/.prettierignore", - "cSpell.words": ["Curr", "doublestar", "multierr"] + "cSpell.words": ["Curr", "doublestar", "ERRORLEVEL", "multierr"] } diff --git a/pipeline/backend/local/command.go b/pipeline/backend/local/command.go index e2b2a7eba..cfa36ad54 100644 --- a/pipeline/backend/local/command.go +++ b/pipeline/backend/local/command.go @@ -31,9 +31,11 @@ func genCmdByShell(shell string, cmds []string) (args []string, err error) { switch strings.TrimSuffix(strings.ToLower(shell), ".exe") { case "cmd": - script := "" + script := "@SET PROMPT=$\n" for _, cmd := range cmds { - script += fmt.Sprintf("%s || exit 1\n", cmd) + script += fmt.Sprintf("@echo + %s\n", strings.TrimSpace(shellescape.Quote(cmd))) + script += fmt.Sprintf("@%s\n", cmd) + script += "@IF NOT %ERRORLEVEL% == 0 exit %ERRORLEVEL%\n" } cmd, err := os.CreateTemp(os.TempDir(), "*.cmd") if err != nil {