1
0
mirror of https://github.com/go-task/task.git synced 2024-12-04 10:24:45 +02:00

fix(remote): TASK_REMOTE_DIR does not work when absolute (#1715)

This commit is contained in:
Valentin Maerten 2024-08-25 23:03:28 +02:00 committed by GitHub
parent 32158dac87
commit c243b0ec7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -134,8 +134,8 @@ func (e *Executor) setupTempDir() error {
} }
if os.Getenv("TASK_REMOTE_DIR") != "" { if os.Getenv("TASK_REMOTE_DIR") != "" {
if filepath.IsAbs(os.Getenv("TASK_TEMP_DIR")) || strings.HasPrefix(os.Getenv("TASK_TEMP_DIR"), "~") { if filepath.IsAbs(os.Getenv("TASK_REMOTE_DIR")) || strings.HasPrefix(os.Getenv("TASK_REMOTE_DIR"), "~") {
remoteTempDir, err := execext.Expand(filepathext.SmartJoin(e.Dir, ".task")) remoteTempDir, err := execext.Expand(os.Getenv("TASK_REMOTE_DIR"))
if err != nil { if err != nil {
return err return err
} }