diff options
| author | Jeff Carr <[email protected]> | 2024-10-23 00:48:35 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-23 00:48:35 -0500 |
| commit | 62d406e0de0fcfe373ae45ed8920dc8a9e3e1034 (patch) | |
| tree | 30263802857ebdf488f70c61d1a55b7b5b290d84 /main.go | |
| parent | a3ea303ab86e5db6510a00e373b6e7a6620d426a (diff) | |
set a homedir
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 24 |
1 files changed, 15 insertions, 9 deletions
@@ -6,6 +6,7 @@ import ( "embed" "fmt" "os" + "path/filepath" "time" "go.wit.com/dev/alexflint/arg" @@ -18,6 +19,11 @@ var Version string var resources embed.FS func main() { + if os.Getenv("VIRTIGO_HOME") == "" { + homeDir, _ := os.UserHomeDir() + fullpath := filepath.Join(homeDir, ".config/virtigo") + os.Setenv("VIRTIGO_HOME", fullpath) + } pp := arg.MustParse(&argv) if !argv.Uptime { @@ -39,16 +45,16 @@ func main() { me.delay = 5 * time.Second /* - log.Info("command line hypervisors:", argv.Hosts) - for _, name := range argv.Hosts { - h := findHypervisor(name) - if h != nil { - log.Info("command line hypervisor", name, "already in config file") - continue + log.Info("command line hypervisors:", argv.Hosts) + for _, name := range argv.Hosts { + h := findHypervisor(name) + if h != nil { + log.Info("command line hypervisor", name, "already in config file") + continue + } + h = addHypervisor(name) + h.pb.Active = true } - h = addHypervisor(name) - h.pb.Active = true - } */ if argv.Start != "" { |
