denoland / deno_install

Deno Binary Installer
https://deno.land/
MIT License
981 stars 185 forks source link

Allow (bsd)tar to unzip #172

Open MarkTiedemann opened 3 years ago

MarkTiedemann commented 3 years ago

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).

alexgleason commented 1 year ago

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.