From 4cefe0bf52f9d60d25858ebb51b870433004a4a6 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 12 Oct 2025 17:50:00 -0500 Subject: cleaning up stuff. finally making progress --- main.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index b2de137..bcd8290 100644 --- a/main.go +++ b/main.go @@ -6,7 +6,6 @@ import ( "os" "path/filepath" - "go.wit.com/lib/config" "go.wit.com/lib/gui/prep" "go.wit.com/lib/gui/shell" "go.wit.com/lib/protobuf/zoopb" @@ -30,13 +29,21 @@ func main() { me.pb = zoopb.NewPackages() me.pb.Filename = "/home/mirrors/wit/mirrors.wit.com.pb" if err := me.pb.Load(); err != nil { - if argv.Force { - config.Save(me.pb) + if argv.Create { + me.pb.BaseDir = "/home/mirrors/wit" + me.pb.Save() + me.sh.GoodExit("created new pb file: " + me.pb.Filename) } else { - me.sh.BadExit("no config found. use --force to create one", err) + me.sh.BadExit("no config found. use --create to create one", err) } } + if me.pb.BaseDir == "" { + me.pb.BaseDir = "/home/mirrors/wit" + me.pb.Save() + me.sh.BadExit("pb.BaseDir is bank", nil) + } + if err := os.Chdir(me.pb.BaseDir); err != nil { me.sh.BadExit("no '"+me.pb.BaseDir+"' directory", err) } -- cgit v1.2.3