deno_install
deno_install copied to clipboard
Allow (bsd)tar to unzip
Currently, we require unzip to be installed for extracing the Zip archive (see https://github.com/denoland/deno_install/blob/master/install.sh#L7-L10, https://github.com/denoland/deno_install#unzip-is-required).
Contrary to gnutar, bsdtar (a tar implementation by libarchive) is able to extract .zip files, too. It's the default tar on FreeBSD, NetBSD, MacOS and Windows (see https://github.com/libarchive/libarchive/wiki/LibarchiveUsers).
So if unzip is unavailable, we could check for (bsd)tar, and only if both are unavailable, fail with an error message.
I'm using a similar technique in deno.mk (see https://github.com/MarkTiedemann/deno.mk/blob/master/deno.mk#L68-L72).
Most Linux distros come with busybox preinstalled, so it's as simple as busybox unzip deno.zip -o /path/to/install
I'm not sure if MacOS has it by default.