somehow dirs aren't saving

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-10-27 08:32:54 -05:00
parent 6934c8a2c4
commit cc092bd895
3 changed files with 3 additions and 9 deletions

View File

@ -14,7 +14,6 @@ var argv args
type args struct { type args struct {
ListRepos bool `arg:"--list-repos" help:"list all repositories"` ListRepos bool `arg:"--list-repos" help:"list all repositories"`
Port int `arg:"--port" default:"2520" help:"port to run on"` Port int `arg:"--port" default:"2520" help:"port to run on"`
Config string `arg:"env:VIRTIGO_HOME" help:"defaults to ~/.config/virtigo/"`
Start string `arg:"--start" help:"start a droplet"` Start string `arg:"--start" help:"start a droplet"`
} }

View File

@ -18,7 +18,6 @@ import (
"embed" "embed"
"net" "net"
"os" "os"
"path/filepath"
"time" "time"
"github.com/digitalocean/go-qemu/hypervisor" "github.com/digitalocean/go-qemu/hypervisor"
@ -33,11 +32,6 @@ var hv *hypervisor.Hypervisor
var resources embed.FS var resources embed.FS
func main() { func main() {
if os.Getenv("VIRTIGO_HOME") == "" {
homeDir, _ := os.UserHomeDir()
fullpath := filepath.Join(homeDir, ".config/virtigo")
os.Setenv("VIRTIGO_HOME", fullpath)
}
var pp *arg.Parser var pp *arg.Parser
pp = arg.MustParse(&argv) pp = arg.MustParse(&argv)
@ -45,6 +39,7 @@ func main() {
pp.WriteHelp(os.Stdout) pp.WriteHelp(os.Stdout)
os.Exit(0) os.Exit(0)
} }
me = new(Virtigod)
me.Hostname, _ = os.Hostname() me.Hostname, _ = os.Hostname()
log.DaemonMode(true) log.DaemonMode(true)

View File

@ -1,9 +1,9 @@
package main package main
var me Virtigod var me *Virtigod
// this app's variables // this app's variables
type Virtigod struct { type Virtigod struct {
Hostname string Hostname string
dirs []string dirs []string
} }