Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Jul 16, 2024
1 parent c39d50b commit 24269e7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions client/v2/helpers/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ func GetNodeHomeDirectory(name string) (string, error) {
// get the home directory from the environment variable
// to not clash with the $HOME system variable, when no prefix is set
// we check the NODE_HOME environment variable
envHome := "HOME"
homeDir, envHome := "", "HOME"
if len(EnvPrefix) > 0 {
homeDir := os.Getenv(EnvPrefix + "_" + envHome)
if homeDir != "" {
return filepath.Clean(homeDir), nil
}
} else if homeDir := os.Getenv("NODE_" + envHome); homeDir != "" {
homeDir = os.Getenv(EnvPrefix + "_" + envHome)
} else {
homeDir = os.Getenv("NODE_" + envHome)
}
if homeDir != "" {
return filepath.Clean(homeDir), nil
}

Expand Down

0 comments on commit 24269e7

Please sign in to comment.