]> Cypherpunks.ru repositories - goredo.git/blobdiff - run.go
Do not use legacy os.IsNotExist
[goredo.git] / run.go
diff --git a/run.go b/run.go
index 90eb7e6ec1669c996efb04dd7a2c837b46cb2203..dd41fbcc01927463f327d043321f828e22a9637f 100644 (file)
--- a/run.go
+++ b/run.go
@@ -31,7 +31,6 @@ import (
        "os"
        "os/exec"
        "path"
-       "path/filepath"
        "strconv"
        "strings"
        "sync"
@@ -260,7 +259,7 @@ func runScript(tgtOrig string, errs chan error, forced, traced bool) error {
                        var depInfo *DepInfo
                        fdDep, err := os.Open(path.Join(redoDir, tgt+DepSuffix))
                        if err != nil {
-                               if os.IsNotExist(err) {
+                               if errors.Is(err, fs.ErrNotExist) {
                                        err = errors.New("was not built: no .rec")
                                }
                                goto Finish
@@ -395,10 +394,7 @@ func runScript(tgtOrig string, errs chan error, forced, traced bool) error {
        stdoutPath := fdStdout.Name()
        fdStdout.Close()
        tmpPath := stdoutPath + ".3" // and for $3
-       tmpPathRel, err := filepath.Rel(cwd, tmpPath)
-       if err != nil {
-               panic(err)
-       }
+       tmpPathRel := mustRel(cwd, tmpPath)
        args = append(
                args,
                path.Join(dirPrefix, tgt),
@@ -714,7 +710,7 @@ func runScript(tgtOrig string, errs chan error, forced, traced bool) error {
                                return
                        }
                        tmpExists = true
-               } else if !os.IsNotExist(err) {
+               } else if !errors.Is(err, fs.ErrNotExist) {
                        runErr.Err = ErrLine(err)
                        errs <- runErr
                        return