mirror of
https://github.com/danbulant/deno_install
synced 2026-07-05 03:00:48 +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
|
## 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`:
|
One application of this is a system-wide Shell installation to `/usr/local`:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,8 @@ else
|
||||||
deno_uri="https://github.com/denoland/deno/releases/download/${1}/deno_${os}_x64.gz"
|
deno_uri="https://github.com/denoland/deno/releases/download/${1}/deno_${os}_x64.gz"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
deno_install=${DENO_INSTALL:-$HOME/.deno}
|
deno_install="${DENO_INSTALL:-$HOME/.local}"
|
||||||
bin_dir="${deno_install}/bin"
|
bin_dir="$deno_install/bin"
|
||||||
exe="$bin_dir/deno"
|
exe="$bin_dir/deno"
|
||||||
|
|
||||||
if [ ! -d "$bin_dir" ]; then
|
if [ ! -d "$bin_dir" ]; then
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,12 @@ set -e
|
||||||
# Lint.
|
# Lint.
|
||||||
# TODO(ry) shellcheck -s sh ./*.sh
|
# TODO(ry) shellcheck -s sh ./*.sh
|
||||||
|
|
||||||
# Test we can install a specific version.
|
# Test that we can install the latest version at the default location.
|
||||||
rm -rf ~/.deno
|
unset DENO_INSTALL
|
||||||
DENO_INSTALL='' ./install.sh v0.13.0
|
sh ./install.sh
|
||||||
~/.deno/bin/deno --version | grep 0.13.0
|
~/.local/bin/deno --version
|
||||||
|
|
||||||
# Test we can install the latest version.
|
# Test that we can install a specific version at a custom location.
|
||||||
rm -rf ~/.deno
|
export DENO_INSTALL="$HOME/deno-0.13.0"
|
||||||
DENO_INSTALL="$HOME/.deno-test" sh ./install.sh
|
./install.sh v0.13.0
|
||||||
~/.deno-test/bin/deno --version
|
~/deno-0.13.0/bin/deno --version | grep 0.13.0
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue