Skip to content

Commit

Permalink
Feat (app): use conditional method to set internal environment variab…
Browse files Browse the repository at this point in the history
…les only if it not exists yet
  • Loading branch information
mateussouzaweb committed Nov 8, 2024
1 parent 20a30f4 commit 136a9e2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ func main() {
listenAddress := cli.Arg(os.Args[1:], "--address", "127.0.0.1:14935")

// Expose environment variables for internal usage
os.Setenv("APPLICATIONS", os.ExpandEnv("$HOME/Applications"))
os.Setenv("GAMES", os.ExpandEnv("$HOME/Games"))
os.Setenv("BIOS", os.ExpandEnv("$HOME/Games/BIOS"))
os.Setenv("ROMS", os.ExpandEnv("$HOME/Games/ROMs"))
os.Setenv("STATE", os.ExpandEnv("$HOME/Games/STATE"))
cli.SetEnv("APPLICATIONS", os.ExpandEnv("$HOME/Applications"), false)
cli.SetEnv("GAMES", os.ExpandEnv("$HOME/Games"), false)
cli.SetEnv("BIOS", os.ExpandEnv("$GAMES/BIOS"), false)
cli.SetEnv("ROMS", os.ExpandEnv("$GAMES/ROMs"), false)
cli.SetEnv("STATE", os.ExpandEnv("$GAMES/STATE"), false)

// Run the program server
go func() {
Expand Down

0 comments on commit 136a9e2

Please sign in to comment.