Option to change temp dir for local backend (#2702)

---
*Sponsored by Kithara Software GmbH*
This commit is contained in:
6543
2023-11-02 15:45:18 +01:00
committed by GitHub
parent da6f39258d
commit 7bc40f20cb
5 changed files with 35 additions and 6 deletions

View File

@@ -22,7 +22,7 @@ import (
"github.com/alessio/shellescape"
)
func genCmdByShell(shell string, cmds []string) (args []string, err error) {
func (e *local) genCmdByShell(shell string, cmds []string) (args []string, err error) {
script := ""
for _, cmd := range cmds {
script += fmt.Sprintf("echo %s\n%s\n", strings.TrimSpace(shellescape.Quote("+ "+cmd)), cmd)
@@ -37,7 +37,7 @@ func genCmdByShell(shell string, cmds []string) (args []string, err error) {
script += fmt.Sprintf("@%s\n", cmd)
script += "@IF NOT %ERRORLEVEL% == 0 exit %ERRORLEVEL%\n"
}
cmd, err := os.CreateTemp(os.TempDir(), "*.cmd")
cmd, err := os.CreateTemp(e.tempDir, "*.cmd")
if err != nil {
return nil, err
}