diff options
| author | Jeff Carr <[email protected]> | 2025-10-12 17:50:00 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-13 03:28:10 -0500 |
| commit | 4cefe0bf52f9d60d25858ebb51b870433004a4a6 (patch) | |
| tree | f859c5b64c25abe0e4413aeb44e120a7c9ae1901 /main.go | |
| parent | 29bb90b293a8bda889ff30bb56d05ce47af4a9bf (diff) | |
cleaning up stuff. finally making progress
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -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) } |
