mirror of
https://github.com/danbulant/deno_install
synced 2026-06-18 05:51:32 +00:00
Default DENO_INSTALL to $HOME/.local (#89)
This commit is contained in:
parent
7b3d3daf45
commit
654d0ea309
3 changed files with 11 additions and 11 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue