Skip to content

Commit

Permalink
fix: resolve executable symlink
Browse files Browse the repository at this point in the history
  • Loading branch information
jozefcipa committed May 15, 2024
1 parent b5afdb4 commit 920b65c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/fs/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ func ResolveDirs() {
logger.Errorf("Failed to get novus binary directory\n Reason: %v", err)
os.Exit(1)
}
// Homebrew creates symlinks for binaries, we need to get the original binary location
executablePath, err = filepath.EvalSymlinks(executablePath)
if err != nil {
logger.Errorf("Failed to evaluate novus symlink\n Reason: %v", err)
os.Exit(1)
}
NovusBinaryDir = filepath.Dir(executablePath)
// When running in development with `go run` it gives temporary directory,
// therefore set the novus dir path to the current directory
Expand All @@ -52,12 +58,6 @@ func ResolveDirs() {
// This is the Homebrew structure
// - ./bin/novus
// - ./assets/...
// Homebrew creates symlinks for binaries, we need to get the original binary location
NovusBinaryDir, err = filepath.EvalSymlinks(NovusBinaryDir)
if err != nil {
logger.Errorf("Failed to evaluate novus symlink\n Reason: %v", err)
os.Exit(1)
}
AssetsDir = filepath.Join(NovusBinaryDir, "..", "assets")
}

Expand Down

0 comments on commit 920b65c

Please sign in to comment.