]> Cypherpunks.ru repositories - goredo.git/commitdiff
Fix another whichdo regression fix v2.4.0
authorSergey Matveev <stargrave@stargrave.org>
Fri, 17 Nov 2023 16:10:01 +0000 (19:10 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Fri, 17 Nov 2023 16:10:01 +0000 (19:10 +0300)
doc/news.texi
main.go
usage.go
whichdo.go

index ae1ca4a02a125c648c51fc827a018cef9b699c53..2684d05980e30ede550e05f265254b3f2f38928e 100644 (file)
@@ -2,6 +2,13 @@
 @cindex news
 @unnumbered News
 
+@anchor{Release 2_4_0}
+@section Release 2.4.0
+@itemize
+@item
+    Continue regression fixing of @command{redo-whichdo}.
+@end itemize
+
 @anchor{Release 2_3_0}
 @section Release 2.3.0
 @itemize
diff --git a/main.go b/main.go
index d6ac0d31147a1e73bc8de599a25ef14da2869fb9..504fa6c02beba2fa8f671a54833b0bb5bede8026 100644 (file)
--- a/main.go
+++ b/main.go
@@ -21,9 +21,11 @@ import (
        "bufio"
        "bytes"
        "encoding/hex"
+       "errors"
        "flag"
        "fmt"
        "io"
+       "io/fs"
        "log"
        "os"
        "os/signal"
@@ -392,7 +394,12 @@ func main() {
                var dos []string
                dos, err = whichdo(tgts[0])
                if err != nil {
-                       break
+                       if errors.Is(err, fs.ErrNotExist) {
+                               err = nil
+                               ok = false
+                       } else {
+                               break
+                       }
                }
                for _, do := range dos {
                        fmt.Println(do)
index a091a92f21972ed6b606036b8c2dc47e112af77b..cb2761f58700d113ba87bf4545c3e866a8bf5b29 100644 (file)
--- a/usage.go
+++ b/usage.go
@@ -24,7 +24,7 @@ import (
 )
 
 const (
-       Version  = "2.3.0"
+       Version  = "2.4.0"
        Warranty = `Copyright (C) 2020-2023 Sergey Matveev
 
 This program is free software: you can redistribute it and/or modify
index 4a22b10c32ce28ec7d354779b0e67fb139e74f95..5078775b490a9353ab350e71d4b5c34cf18dd509 100644 (file)
@@ -1,8 +1,8 @@
 package main
 
 import (
-       "errors"
        "io"
+       "io/fs"
        "os"
        "path"
 )
@@ -51,7 +51,7 @@ func whichdo(tgt *Tgt) (dos []string, err error) {
                }
        }
        if doFile == "" {
-               err = errors.New("no .do found")
+               err = fs.ErrNotExist
                return
        }
        p := make([]string, 0, upLevels+2)