Default DENO_INSTALL to $HOME/.local (#89)

This commit is contained in:
Nayeem Rahman 2019-12-07 20:23:17 +00:00 committed by Ry Dahl
parent 7b3d3daf45
commit 654d0ea309
3 changed files with 11 additions and 11 deletions

View file

@ -70,7 +70,7 @@ asdf local deno 0.2.10
## Environment Variables
- `DENO_INSTALL` - The directory in which to install Deno. This defaults to `$HOME/.deno`.
- `DENO_INSTALL` - The directory in which to install Deno. On Linux, this defaults to `$HOME/.local`.
One application of this is a system-wide Shell installation to `/usr/local`:
```sh

View file

@ -31,8 +31,8 @@ else
deno_uri="https://github.com/denoland/deno/releases/download/${1}/deno_${os}_x64.gz"
fi
deno_install=${DENO_INSTALL:-$HOME/.deno}
bin_dir="${deno_install}/bin"
deno_install="${DENO_INSTALL:-$HOME/.local}"
bin_dir="$deno_install/bin"
exe="$bin_dir/deno"
if [ ! -d "$bin_dir" ]; then

View file

@ -5,12 +5,12 @@ set -e
# Lint.
# TODO(ry) shellcheck -s sh ./*.sh
# Test we can install a specific version.
rm -rf ~/.deno
DENO_INSTALL='' ./install.sh v0.13.0
~/.deno/bin/deno --version | grep 0.13.0
# Test that we can install the latest version at the default location.
unset DENO_INSTALL
sh ./install.sh
~/.local/bin/deno --version
# Test we can install the latest version.
rm -rf ~/.deno
DENO_INSTALL="$HOME/.deno-test" sh ./install.sh
~/.deno-test/bin/deno --version
# Test that we can install a specific version at a custom location.
export DENO_INSTALL="$HOME/deno-0.13.0"
./install.sh v0.13.0
~/deno-0.13.0/bin/deno --version | grep 0.13.0