Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
do that
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbhmr authored Nov 20, 2023
1 parent 225a0a6 commit 3873526
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 22 deletions.
36 changes: 15 additions & 21 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,21 @@ else
fi

if [ "$OS" = "Windows_NT" ]; then
curl.exe -fsSL "${base_url}denow.bat" -o ./denow.bat
curl.exe -fsSL "${base_url}denow" -o ./denow
chmod +x ./denow
pwsh -Command "v='$1'; irm ${DENOW_DL_BASE_URL}/install.ps1 | iex"
exit 0
fi

if command -v curl 2> /dev/null; then
curl -fsSL "${base_url}denow.bat" -o ./denow.bat
curl -fsSL "${base_url}denow" -o ./denow
elif command -v wget 2> /dev/null; then
wget "${base_url}denow.bat" -O ./denow.bat
wget "${base_url}denow" -O ./denow
else
if command -v curl 2> /dev/null; then
curl -fsSL "${base_url}denow.bat" -o ./denow.bat
curl -fsSL "${base_url}denow" -o ./denow
elif command -v wget 2> /dev/null; then
wget "${base_url}denow.bat" -O ./denow.bat
wget "${base_url}denow" -O ./denow
else
echo "Neither 'curl' nor 'wget' found." >&2
exit 1
fi
chmod +x ./denow
echo "Neither 'curl' nor 'wget' found." >&2
exit 1
fi
chmod +x ./denow

if [ -n "$1" ]; then
deno_version="$1"
Expand All @@ -35,12 +34,7 @@ else
exit 1
fi

if [ "$OS" = "Windows_NT" ]; then
powershell -Command "(gc ./denow.bat) -replace '%__DENO_VERSION__%', '$deno_version' | Out-File -encoding ASCII ./denow.bat"
powershell -Command "(gc ./denow.bat) -replace '\$__DENO_VERSION__', '$deno_version' | Out-File -encoding ASCII ./denow"
else
sed -i "s/%__DENO_VERSION__%/$deno_version/g" ./denow.bat
sed -i "s/\$__DENO_VERSION__/$deno_version/g" ./denow
fi
sed -i "s/%__DENO_VERSION__%/$deno_version/g" ./denow.bat
sed -i "s/\$__DENO_VERSION__/$deno_version/g" ./denow

echo "Created wrapper! You can use ./denow to launch Deno."
2 changes: 1 addition & 1 deletion install_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -ex

python -m http.server 7000 &
sleep 3s # let server get ready
sleep 3 # let server get ready

export DENOW_DL_BASE_URL="http://localhost:7000/"

Expand Down

0 comments on commit 3873526

Please sign in to comment.