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
5 changes: 5 additions & 0 deletions public/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ have() { command -v "$1" >/dev/null 2>&1; }
say "Installing crawlproof (CrawlProof CLI)..."

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@latest"
BIN_DIR="${BUN_INSTALL:-$HOME/.bun}/bin"
elif have npm && have node; then
Expand Down