From 6d19a5f537ed69ab769ece4e5123ddaa1491c3ec Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 12 Sep 2018 11:23:34 +0200 Subject: Let aport argument have precedence over current dir --- aports-ghpr.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/aports-ghpr.go b/aports-ghpr.go index 67d6f94..851d925 100644 --- a/aports-ghpr.go +++ b/aports-ghpr.go @@ -28,17 +28,14 @@ func main() { var aport string if flag.NArg() >= 1 { aport = flag.Arg(0) - } - - // if APKBUILD exists in current directory, then we limit the search - if _, err := os.Stat("APKBUILD"); err == nil { + } else if _, err := os.Stat("APKBUILD"); err == nil { + // if APKBUILD exists in current directory, then we limit the search dir, err := os.Getwd() if err != nil { log.Fatal(err) } aport = path.Base(dir) - fmt.Println("searching for: ", aport) } if aport == "" { @@ -46,6 +43,7 @@ func main() { os.Exit(1) } + fmt.Println("searching for: ", aport) // TODO: allow set authentication client := github.NewClient(nil) -- cgit v1.2.3