mirror of
https://github.com/danbulant/deno_install
synced 2026-07-06 19:50:48 +00:00
sh: Remove hardcoded version (#29)
This commit is contained in:
parent
9ff2b1432a
commit
1b9738eeb3
1 changed files with 11 additions and 9 deletions
20
install.sh
20
install.sh
|
|
@ -4,10 +4,19 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
case $(uname -s) in
|
||||||
|
Darwin) os="osx" ;;
|
||||||
|
*) os="linux" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then
|
||||||
version="v0.2.7"
|
deno_asset_path=$(curl -sSf https://github.com/denoland/deno/releases |
|
||||||
|
grep -o "/denoland/deno/releases/download/.*/deno_${os}_x64\.gz" |
|
||||||
|
head -n 1)
|
||||||
|
if [ ! "$deno_asset_path" ]; then exit 1; fi
|
||||||
|
deno_uri="https://github.com${deno_asset_path}"
|
||||||
else
|
else
|
||||||
version=$1
|
deno_uri="https://github.com/denoland/deno/releases/download/${1}/deno_${os}_x64.gz"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
bin_dir="$HOME/.deno/bin"
|
bin_dir="$HOME/.deno/bin"
|
||||||
|
|
@ -17,13 +26,6 @@ if [ ! -d "$bin_dir" ]; then
|
||||||
mkdir -p "$bin_dir"
|
mkdir -p "$bin_dir"
|
||||||
fi
|
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 "$exe.gz" "$deno_uri"
|
curl -fL# -o "$exe.gz" "$deno_uri"
|
||||||
gunzip -df "$exe.gz"
|
gunzip -df "$exe.gz"
|
||||||
chmod +x "$exe"
|
chmod +x "$exe"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue