Skip to content

Commit

Permalink
install: allow busybox unzip
Browse files Browse the repository at this point in the history
according to issue #172, `busybox unzip` is an alternative to
installing unzip or 7z.

busybox is installed by default on Ubuntu 24.04.1 LTS but unzip/7z are not.

note: busybox is not installed on macOS 15.3 by default but unzip is.
  • Loading branch information
erg committed Jan 29, 2025
1 parent 7312478 commit 5b4d542
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

set -e

if ! command -v unzip >/dev/null && ! command -v 7z >/dev/null; then
echo "Error: either unzip or 7z is required to install Deno (see: https://github.com/denoland/deno_install#either-unzip-or-7z-is-required )." 1>&2
if ! command -v unzip >/dev/null && ! command -v busybox unzip > /dev/null && ! command -v 7z >/dev/null; then
echo "Error: either unzip or busybox unzip or 7z are required to install Deno (see: https://github.com/denoland/deno_install#either-unzip-or-7z-is-required )." 1>&2
exit 1
fi

Expand Down Expand Up @@ -79,6 +79,8 @@ fi
curl --fail --location --progress-bar --output "$exe.zip" "$deno_uri"
if command -v unzip >/dev/null; then
unzip -d "$bin_dir" -o "$exe.zip"
elif command -v busybox >/dev/null; then
busybox unzip -d "$bin_dir" -o "$exe.zip"
else
7z x -o"$bin_dir" -y "$exe.zip"
fi
Expand Down

0 comments on commit 5b4d542

Please sign in to comment.