diff --git a/public/install.sh b/public/install.sh index b77883b2..d4c17853 100755 --- a/public/install.sh +++ b/public/install.sh @@ -16,6 +16,11 @@ have() { command -v "$1" >/dev/null 2>&1; } say "Installing qc (qrypt.chat terminal client)..." if have bun; then + # bun add -g writes into the nearest package.json above its global dir when + # that dir has none (e.g. ~/package.json): give it its own first. + BUN_GLOBAL="${BUN_INSTALL:-$HOME/.bun}/install/global" + mkdir -p "$BUN_GLOBAL" + [ -f "$BUN_GLOBAL/package.json" ] || printf '{}\n' > "$BUN_GLOBAL/package.json" bun add -g "$PKG" BIN_DIR="${BUN_INSTALL:-$HOME/.bun}/bin" elif have npm && have node; then