From 6266daf3965402077cb14e8997b20695657394db Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sat, 9 Jan 2021 16:00:07 +0300 Subject: [PATCH] Record relative path to .do --- run.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/run.go b/run.go index f085470..aab8e9a 100644 --- a/run.go +++ b/run.go @@ -266,12 +266,14 @@ func runScript(tgtOrig string, errs chan error, traced bool) error { } // Determine basename and DIRPREFIX + doFileRelPath := doFile ents := strings.Split(cwd, "/") ents = ents[len(ents)-upLevels:] dirPrefix := path.Join(ents...) cwdOrig := cwd for i := 0; i < upLevels; i++ { cwd = path.Join(cwd, "..") + doFileRelPath = path.Join("..", doFileRelPath) } cwd = path.Clean(cwd) doFilePath := path.Join(cwd, doFile) @@ -279,10 +281,10 @@ func runScript(tgtOrig string, errs chan error, traced bool) error { runErr := RunErr{Tgt: tgtOrig} if strings.HasPrefix(doFile, "default.") { basename = tgt[:len(tgt)-(len(doFile)-len("default.")-len(".do"))-1] - runErr.DoFile = doFile + runErr.DoFile = doFileRelPath } - if err = writeDep(fdDep, cwd, doFile); err != nil { + if err = writeDep(fdDep, cwdOrig, doFileRelPath); err != nil { cleanup() return TgtErr{tgtOrig, err} } -- 2.44.0