Skip to content

Commit 89ecbd9

Browse files
authored
Support 7z as well as unzip
2 parents 101a27a + 7eeb228 commit 89ecbd9

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -156,18 +156,18 @@ scoop reset deno
156156

157157
## Known Issues
158158

159-
### unzip is required
159+
### either unzip or 7z is required
160160

161-
The program [`unzip`](https://linux.die.net/man/1/unzip) is a requirement for the Shell installer.
161+
To decompress the `deno` archive, one of either [`unzip`](https://linux.die.net/man/1/unzip) or [`7z`](https://linux.die.net/man/1/7z) must be available on the target system.
162162

163163
```sh
164164
$ curl -fsSL https://deno.land/install.sh | sh
165-
Error: unzip is required to install Deno (see: https://github.com/denoland/deno_install#unzip-is-required).
165+
Error: either unzip or 7z is required to install Deno (see: https://github.com/denoland/deno_install#either-unzip-or-7z-is-required ).
166166
```
167167

168168
**When does this issue occur?**
169169

170-
During the `install.sh` process, `unzip` is used to extract the zip archive.
170+
During the `install.sh` process, `unzip` or `7z` is used to extract the zip archive.
171171

172172
**How can this issue be fixed?**
173173

install.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
set -e
66

7-
if ! command -v unzip >/dev/null; then
8-
echo "Error: unzip is required to install Deno (see: https://github.com/denoland/deno_install#unzip-is-required )." 1>&2
7+
if ! command -v unzip >/dev/null && ! command -v 7z >/dev/null; then
8+
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
99
exit 1
1010
fi
1111

@@ -38,7 +38,11 @@ if [ ! -d "$bin_dir" ]; then
3838
fi
3939

4040
curl --fail --location --progress-bar --output "$exe.zip" "$deno_uri"
41-
unzip -d "$bin_dir" -o "$exe.zip"
41+
if command -v unzip >/dev/null; then
42+
unzip -d "$bin_dir" -o "$exe.zip"
43+
else
44+
7z x -o"$bin_dir" -y "$exe.zip"
45+
fi
4246
chmod +x "$exe"
4347
rm "$exe.zip"
4448

0 commit comments

Comments
 (0)