From 0322b3ad856345c1e3c848e06c8d27caee6856af Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 11 Feb 2024 13:56:59 -0600 Subject: builds automatically Signed-off-by: Jeff Carr --- main.go | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 55101d4..5ebdc7b 100644 --- a/main.go +++ b/main.go @@ -20,6 +20,12 @@ var cBox *controlBox var basicWindow *gadgets.BasicWindow func main() { + if args.Repo == "" { + log.Info("You need to tell me what repo you want to work on") + println("") + println("go-deb --repo go.wit.com/apps/helloworld") + os.Exit(0) + } if debugger.ArgDebug() { log.SetAll(true) log.ShowFlags() @@ -33,20 +39,18 @@ func main() { basicWindow = makebasicWindow() - if args.Repo != "" { - filepath := filepath.Join("/home/jcarr/go/src", args.Repo) - os.Chdir(filepath) + filepath := filepath.Join("/home/jcarr/go/src", args.Repo) + os.Chdir(filepath) - cBox.addRepo(args.Repo) - cBox.readControlFile() - basicWindow.Show() - // go will sit here until the window exits - gui.Watchdog() - } - if args.OpenGui { - basicWindow.Show() - // go will sit here until the window exits - gui.Watchdog() + cBox.addRepo(args.Repo) + cBox.readControlFile() + if args.NoGui { + if cBox.buildPackage() { + log.Info("build worked") + } else { + log.Warn("build failed") + } + os.Exit(0) } // run the debugger if triggered from the commandline @@ -56,4 +60,9 @@ func main() { debugger.DebugWindow() }() } + + basicWindow.Show() + // go will sit here until the window exits + gui.Watchdog() + os.Exit(0) } -- cgit v1.2.3