run.go | 6 ++++-- diff --git a/run.go b/run.go index f54b86bcd4a0e12b7fc7dff196279fcb7786688db6f36f73d8cc69cfde922a8f..1b6bbddc487813b9ad7b7f333239fdee703394c8767cad88caa5dc415d16fa16 100644 --- a/run.go +++ b/run.go @@ -266,12 +266,14 @@ return TgtErr{tgtOrig, errors.New("no .do found")} } // 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 @@ basename := tgt 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} }