Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[issue-117] Unzip #122

Merged
merged 17 commits into from
May 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,34 @@ scoop reset deno
## Compatibility

- The Shell installer can be used on Windows via the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/about).

## Known Issues

### unzip is required

The program [`unzip`](https://linux.die.net/man/1/unzip) is a requirement for the Shell installer.

```sh
$ curl -fsSL https://deno.land/x/install/install.sh | sh
Error: unzip is required to install Deno (see: https://github.com/denoland/deno_install#unzip-is-required).
```

**When does this issue occur?**

During the `install.sh` process, `unzip` is used to extract the zip archive.

**How can this issue be fixed?**

You can install unzip via `brew install unzip` on MacOS or `apt-get install unzip -y` on Linux.

**When does this issue occur?**

If your systems' [ExecutionPolicy](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies) is `Undefined` or `Restricted`.

**How can this issue be fixed?**

Allow scripts that are downloaded from the internet to be executed by setting the execution policy to `RemoteSigned`:

```powershell
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
```
21 changes: 17 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@

set -e

if [ "$(uname -m)" != "x86_64" ]; then
echo "Error: Unsupported architecture $(uname -m). Only x64 binaries are available." 1>&2
exit 1
fi

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

case $(uname -s) in
Darwin) target="x86_64-apple-darwin" ;;
*) target="x86_64-unknown-linux-gnu" ;;
Expand All @@ -16,11 +26,14 @@ fi

if [ $# -eq 0 ]; then
deno_asset_path=$(
command curl -sSf https://github.com/denoland/deno/releases |
command grep -o "/denoland/deno/releases/download/.*/deno-${target}\\.zip" |
command head -n 1
curl -sSf https://github.com/denoland/deno/releases |
grep -o "/denoland/deno/releases/download/.*/deno-${target}\\.zip" |
head -n 1
)
if [ ! "$deno_asset_path" ]; then exit 1; fi
if [ ! "$deno_asset_path" ]; then
echo "Error: Unable to find latest Deno release on GitHub." 1>&2
exit 1
fi
deno_uri="https://github.com${deno_asset_path}"
else
deno_uri="https://github.com/denoland/deno/releases/download/${1}/deno-${target}.zip"
Expand Down