Skip to content

Commit 353b879

Browse files
committed
add support for wget as a fallback for downloading bun
1 parent e4180b8 commit 353b879

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/bun_install.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,13 @@ if [[ ! -d $bin_dir ]]; then
142142
error "Failed to create install directory \"$bin_dir\""
143143
fi
144144

145-
curl --fail --location --progress-bar --output "$exe.zip" "$bun_uri" ||
145+
if command -v curl >/dev/null 2>&1; then
146+
curl --fail --location --progress-bar --output "$exe.zip" "$bun_uri" ||
146147
error "Failed to download bun from \"$bun_uri\""
148+
else
149+
wget --quiet --show-progress --output-document="$exe.zip" "$bun_uri" ||
150+
error "Failed to download bun from \"$bun_uri\""
151+
fi
147152

148153
unzip -oqd "$bin_dir" "$exe.zip" ||
149154
error 'Failed to extract bun'

0 commit comments

Comments
 (0)