Skip to content

Commit

Permalink
refactor config loading: avoid redundant HOME env calls
Browse files Browse the repository at this point in the history
  • Loading branch information
murakamikaze committed Oct 6, 2024
1 parent 502fc26 commit 0fee5ff
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ func LoadConfig() Config {
logger.Warning("No .env file found, using default environment variables")
}

nodeHome := os.Getenv("NODE_HOME")
if nodeHome == "" {
nodeHome = os.Getenv("HOME") + "/hl"
}
homeDir := os.Getenv("HOME")
nodeHome := os.Getenv("NODE_HOME")
if nodeHome == "" {
nodeHome = homeDir + "/hl"
}

nodeBinary := os.Getenv("NODE_BINARY")
if nodeBinary == "" {
homeDir = os.Getenv("HOME")
nodeBinary = homeDir + "/hl-visor"
}

Expand Down

0 comments on commit 0fee5ff

Please sign in to comment.