Skip to content

Commit

Permalink
fix: always resolve symlinks for the executable path in the self-upda…
Browse files Browse the repository at this point in the history
…ter (#5352)

Otherwise `homebrew` but also other setups might fail since we will replace the symlink instead of the actual binary.
  • Loading branch information
TimBeyer committed Nov 6, 2023
1 parent aba79f5 commit 7ee19dd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/commands/self-update.ts
Expand Up @@ -28,6 +28,7 @@ import { gardenEnv } from "../constants.js"
import semver from "semver"
import stream from "stream"
import type { Log } from "../logger/log-entry.js"
import { realpath } from "fs/promises"

const ARM64_INTRODUCTION_VERSION = "0.13.12"

Expand Down Expand Up @@ -265,7 +266,7 @@ export class SelfUpdateCommand extends Command<SelfUpdateArgs, SelfUpdateOpts> {

let installationDirectory = opts["install-dir"]
let platform = opts.platform
const processExecPath = process.env.GARDEN_SEA_EXECUTABLE_PATH || process.execPath
const processExecPath = await realpath(process.env.GARDEN_SEA_EXECUTABLE_PATH || process.execPath)

if (!installationDirectory) {
installationDirectory = dirname(processExecPath)
Expand Down

0 comments on commit 7ee19dd

Please sign in to comment.