Skip to content

Commit d62064d

Browse files
authored
fix(deploy): prepend Bun + PM2 install dirs to PATH (#59)
appleboy/ssh-action runs a non-interactive non-login shell, so the host's ~/.bashrc and ~/.profile — which is where the Bun installer adds ~/.bun/bin to PATH — never gets sourced. The first `bun` invocation in the deploy script crashes with "command not found" even though Bun is installed. Prepend $HOME/.bun/bin, $HOME/.local/bin, and /usr/local/bin to PATH at the top of the script so `bun` and `pm2` resolve regardless of how the script is invoked.
1 parent 3d2a17d commit d62064d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

scripts/deploy.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
set -euo pipefail
66

7+
# appleboy/ssh-action runs a non-interactive non-login shell, so the host's
8+
# ~/.bashrc / ~/.profile (where Bun and PM2 add themselves to PATH) is
9+
# never sourced. Re-add both binaries' default install dirs explicitly so
10+
# `bun` and `pm2` resolve regardless of how this script was invoked.
11+
export PATH="$HOME/.bun/bin:$HOME/.local/bin:/usr/local/bin:$PATH"
12+
713
BACKUPS_DIR="prisma/backups"
814
KEEP_BACKUPS=10
915

0 commit comments

Comments
 (0)