mirror of
https://github.com/danbulant/deno_install
synced 2026-06-21 15:51:46 +00:00
35 lines
744 B
Bash
Executable file
35 lines
744 B
Bash
Executable file
#!/bin/sh
|
|
# Copyright 2018 the Deno authors. All rights reserved. MIT license.
|
|
# TODO(everyone): Keep this script simple and easily auditable.
|
|
|
|
set -e
|
|
|
|
if [ $# -eq 0 ]; then
|
|
version="v0.2.6"
|
|
else
|
|
version=$1
|
|
fi
|
|
|
|
deno_dir="$HOME/.deno/bin"
|
|
|
|
if [ ! -d "$deno_dir" ]; then
|
|
mkdir -p "$deno_dir"
|
|
fi
|
|
|
|
case $(uname -s) in
|
|
Darwin) os="osx" ;;
|
|
*) os="linux" ;;
|
|
esac
|
|
|
|
deno_uri="https://github.com/denoland/deno/releases/download/${version}/deno_${os}_x64.gz"
|
|
|
|
curl -fL# -o "$deno_dir/deno.gz" "$deno_uri"
|
|
gunzip -df "$deno_dir/deno.gz"
|
|
chmod +x "$deno_dir/deno"
|
|
|
|
echo "Deno was installed successfully."
|
|
if command -v deno >/dev/null; then
|
|
echo "Run 'deno --help' to get started."
|
|
else
|
|
echo "Run '~/.deno/bin/deno --help' to get started."
|
|
fi
|