From d447cc3f194db2e0f46ad15f162713cc24db3a18 Mon Sep 17 00:00:00 2001 From: Pete Davison Date: Tue, 27 Jun 2023 16:51:54 +0000 Subject: [PATCH] chore: make sources paths relative --- variables.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/variables.go b/variables.go index d97a40b6..9038d4d3 100644 --- a/variables.go +++ b/variables.go @@ -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 != "" {