aboutsummaryrefslogtreecommitdiffstats
path: root/aports-ghpr.go
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-09-12 11:23:34 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2018-09-12 11:23:34 +0200
commit6d19a5f537ed69ab769ece4e5123ddaa1491c3ec (patch)
tree79d8498912cbd45633ab4403b19a951749f12f71 /aports-ghpr.go
parentbbc89ecfd1554fd74b1e747caf37a63e5e1e0e46 (diff)
downloadaports-ghpr-6d19a5f537ed69ab769ece4e5123ddaa1491c3ec.tar.bz2
aports-ghpr-6d19a5f537ed69ab769ece4e5123ddaa1491c3ec.tar.xz
Let aport argument have precedence over current dir
Diffstat (limited to 'aports-ghpr.go')
-rw-r--r--aports-ghpr.go8
1 files 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)