X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=main.go;h=ed82856be37f842e6c66f9a0607d191388cb40ac;hb=3ad09b01e78cc63612629e435bce6506e05d9253;hp=cd897720079423090d8e7dca9ad754dba162e2a4;hpb=a3d6bbf97e90bf923142d061bc68b28cc1dec2a8;p=goredo.git diff --git a/main.go b/main.go index cd89772..ed82856 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,6 @@ /* goredo -- redo implementation on pure Go -Copyright (C) 2020 Sergey Matveev +Copyright (C) 2020-2021 Sergey Matveev This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -112,6 +112,7 @@ func main() { panic(err) } } + DirPrefix = os.Getenv(EnvDirPrefix) if *flagStderrKeep { mustSetenv(EnvStderrKeep, "1") @@ -199,7 +200,10 @@ func main() { ok := true err = nil cmdName := path.Base(os.Args[0]) - trace(CDebug, "[%s] run: %s %s [%s]", BuildUUID, cmdName, tgts, Cwd) + trace( + CDebug, "[%s] run: %s %s cwd:%s dirprefix:%s", + BuildUUID, cmdName, tgts, Cwd, DirPrefix, + ) CmdSwitch: switch cmdName { @@ -212,7 +216,9 @@ CmdSwitch: } case "redo-ifchange": ok, err = ifchange(tgts, false, traced) - writeDeps(fdDep, tgts) + if err == nil { + err = writeDeps(fdDep, tgts) + } case "redo-ifcreate": if fdDep == nil { log.Fatalln("no", EnvDepFd)