deno_install icon indicating copy to clipboard operation
deno_install copied to clipboard

Allow (bsd)tar to unzip

Open MarkTiedemann opened this issue 4 years ago • 1 comments

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

MarkTiedemann avatar Dec 08 '20 15:12 MarkTiedemann

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.

alexgleason avatar Mar 27 '23 15:03 alexgleason