From ce0fd10064440ebce0fe4941bb15cf4beb14540a Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 17 Sep 2025 01:08:30 -0500 Subject: common argv handling --- doTag.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'doTag.go') diff --git a/doTag.go b/doTag.go index 8d0692a..161a581 100644 --- a/doTag.go +++ b/doTag.go @@ -24,14 +24,20 @@ func FindRepoByFullPath(wd string) *gitpb.Repo { return nil } +func findCurrentPwdRepoOrDie() *gitpb.Repo { + wd, err := os.Getwd() + repo := FindRepoByFullPath(wd) + if repo == nil { + log.Info("Could not find repo:", wd) + badExit(err) + } + return repo +} + func doTag() error { wd, _ := os.Getwd() if argv.Tag.List != nil { - repo := FindRepoByFullPath(wd) - if repo == nil { - log.Info("Could not find repo:", wd) - return nil - } + repo := findCurrentPwdRepoOrDie() tagTablePB := makeTagTablePB(repo.Tags) // tbox := win.Bottom.Box().SetProgName("TBOX") -- cgit v1.2.3