Skip to content

Commit

Permalink
fix(install.sh): Use "unzip -d" instead of changing directory (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
nayeemrmn authored Sep 2, 2020
1 parent b638c90 commit 4d96027
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
3 changes: 1 addition & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ if [ ! -d "$bin_dir" ]; then
fi

curl --fail --location --progress-bar --output "$exe.zip" "$deno_uri"
cd "$bin_dir"
unzip -o "$exe.zip"
unzip -d "$bin_dir" -o "$exe.zip"
chmod +x "$exe"
rm "$exe.zip"

Expand Down
9 changes: 9 additions & 0 deletions install_test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ if (!($DenoVersion -like '*1.0.0*')) {
throw $DenoVersion
}

# Test that we can install at a relative custom location.
Remove-Item "bin" -Recurse -Force -ErrorAction SilentlyContinue
$env:DENO_INSTALL = "."
$v = "1.1.0"; .\install.ps1
$DenoVersion = bin\deno.exe --version
if (!($DenoVersion -like '*1.1.0*')) {
throw $DenoVersion
}

# Test that the old temp file installer still works.
Remove-Item "~\deno-1.0.1" -Recurse -Force -ErrorAction SilentlyContinue
$env:DENO_INSTALL = "$Home\deno-1.0.1"
Expand Down
5 changes: 5 additions & 0 deletions install_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ rm -rf ~/deno-1.0.0
export DENO_INSTALL="$HOME/deno-1.0.0"
./install.sh v1.0.0
~/deno-1.0.0/bin/deno --version | grep 1.0.0

# Test that we can install at a relative custom location.
export DENO_INSTALL="."
./install.sh v1.1.0
bin/deno --version | grep 1.1.0

0 comments on commit 4d96027

Please sign in to comment.