1
0
mirror of https://github.com/go-task/task.git synced 2025-03-05 15:05:42 +02:00

chore: make sources paths relative

This commit is contained in:
Pete Davison 2023-06-27 16:51:54 +00:00 committed by Andrey Nering
parent 6be3ff6141
commit d447cc3f19

View File

@ -2,6 +2,7 @@ package task
import (
"os"
"path/filepath"
"strings"
"github.com/joho/godotenv"
@ -136,6 +137,12 @@ func (e *Executor) compiledTask(call taskfile.Call, evaluateShVars bool) (*taskf
if err != nil {
return nil, err
}
// Make the paths relative to the task dir
for i, v := range list {
if list[i], err = filepath.Rel(new.Dir, v); err != nil {
return nil, err
}
}
}
// Get the list from a variable and split it up
if cmd.For.Var != "" {