]> Cypherpunks.ru repositories - goredo.git/commitdiff
Explicitly remove possibly existed but now empty target result
authorSergey Matveev <stargrave@stargrave.org>
Tue, 15 Dec 2020 12:17:48 +0000 (15:17 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 15 Dec 2020 12:31:55 +0000 (15:31 +0300)
run.go

diff --git a/run.go b/run.go
index 824f6c255ee45a0a165577c2d56f706d9627ebcd..512418b6e448206ba58c1bd7f3e366197c67bd78 100644 (file)
--- a/run.go
+++ b/run.go
@@ -507,6 +507,7 @@ func runScript(tgtOrig string, errs chan error, traced bool) error {
 
                // Do we need to ifcreate it, of ifchange with renaming?
                if fd == nil {
+                       os.Remove(path.Join(cwdOrig, tgt))
                        err = ifcreate(fdDep, tgt)
                        if err != nil {
                                goto Finish