logo

go-deblob

remove binary blobs from a directory
commit: 4a9a227390d1568131d59b5571baa22e40101466
parent: bad6ecfb31536dec0a7b88978c11c0b7f26ba3a9
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Thu, 12 Dec 2019 01:08:39 +0100

Fix exclusion

Diffstat:

Mgo-deblob.go8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/go-deblob.go b/go-deblob.go @@ -45,6 +45,10 @@ func isBlob(filename string) (result bool) { func is_excluded(filename string) bool { for _, exclude := range excludes { matched, err := path.Match(exclude, filename) + if err != nil { + log.Printf("path.Match(%s, %s): %s\n", exclude, filename, err) + return false + } if matched { return true } @@ -98,14 +102,14 @@ func main() { log.SetFlags(log.Lshortfile) workdir := "." - opts, optind, err := getopt.Getopts(os.Args, "e:d:n") + opts, _, err := getopt.Getopts(os.Args, "e:d:n") if err != nil { log.Fatal(err) } for _, opt := range opts { switch opt.Option { case 'e': - append(excludes, opt.Value) + excludes = append(excludes, string(opt.Value)) case 'd': workdir = opt.Value case 'n':