Skip to content

Commit

Permalink
refactor: move config env var above tool exec
Browse files Browse the repository at this point in the history
  • Loading branch information
giusdp committed May 6, 2024
1 parent 102a34e commit b60cf62
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ func main() {
warn("unable to set NUV_OLARIS...", err.Error())
}

nuvRootDir := getRootDirOrExit()
debug("nuvRootDir", nuvRootDir)
err = setAllConfigEnvVars(nuvRootDir, nuvHome)
if err != nil {
log.Fatalf("cannot apply env vars from configs: %s", err.Error())
}

// first argument with prefix "-" is an embedded tool
// using "-" or "--" or "-task" invokes embedded task
trace("OS args:", os.Args)
Expand Down Expand Up @@ -250,13 +257,6 @@ func main() {
os.Exit(0)
}

nuvRootDir := getRootDirOrExit()
debug("nuvRootDir", nuvRootDir)
err = setAllConfigEnvVars(nuvRootDir, nuvHome)
if err != nil {
log.Fatalf("cannot apply env vars from configs: %s", err.Error())
}

// check if olaris was recently updated
checkUpdated(nuvHome, 24*time.Hour)

Expand Down

0 comments on commit b60cf62

Please sign in to comment.