Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions ui/desktop/src/bin/node-setup-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ trap 'log "An error occurred. Exiting with status $?."' ERR

log "Starting node setup (common)."

# GUI-launched macOS apps inherit a minimal PATH that omits the system sbin
# directories, so Hermit's bootstrap cannot find tools like `chown` (which lives
# in /usr/sbin on macOS) and aborts with exit 127. Ensure they are reachable;
# this is harmless on Linux, where these paths are typically already present.
export PATH="/usr/sbin:/sbin:${PATH}"

if [ -n "${GOOSE_PATH_ROOT:-}" ]; then
RESOLVED_GOOSE_CONFIG_DIR="${GOOSE_PATH_ROOT}/config"
elif [ -n "${GOOSE_CONFIG_DIR:-}" ]; then
Expand Down Expand Up @@ -108,11 +114,13 @@ else
log "Hermit environment already initialized. Skipping init."
fi

# Activate the environment with output redirected to log
if [[ "$(uname -s)" == "Linux" ]]; then
log "Activating hermit environment."
{ . "bin/activate-hermit"; } >> "${LOG_FILE}" 2>&1
fi
# Activate the environment with output redirected to log.
# Activation must run on every platform: macOS GUI apps otherwise never get the
# hermit-managed node/npx onto PATH, so STDIO extensions fail with
# "env: node: No such file or directory". The Linux-only guard was introduced in
# #5372 to "preserve existing behavior" on macOS, but that path is now broken.
log "Activating hermit environment."
{ . "bin/activate-hermit"; } >> "${LOG_FILE}" 2>&1

# Install Node.js using hermit
log "Installing Node.js with hermit."
Expand Down