diff options
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 != "" { |
