From 1c8f55d397acb6b653d83f050d15329d7de33bfd Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 13 Dec 2024 20:32:07 -0600 Subject: move checks to panic in safer places --- main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 6b6a74e..4fce146 100644 --- a/main.go +++ b/main.go @@ -4,6 +4,7 @@ import ( "embed" "os" "path/filepath" + "strings" "go.wit.com/dev/alexflint/arg" "go.wit.com/gui" @@ -111,10 +112,13 @@ func main() { } } - me.startRepo = me.forge.Repos.FindByGoPath("go.wit.com/apps/helloworld") + pwd, _ := os.Getwd() + basedir := strings.TrimPrefix(pwd, me.forge.GetGoSrc()) + basedir = strings.Trim(basedir, "/") + me.startRepo = me.forge.Repos.FindByGoPath(basedir) if me.startRepo == nil { - log.Info("Can not release if guireleaser was not found") + log.Info("Can not run if pwd is not a repo", basedir) os.Exit(0) } me.Enable() -- cgit v1.2.3