-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathscript.sh
executable file
·45 lines (37 loc) · 1 KB
/
script.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
source ~/.nvm/nvm.sh
if ! $(command -v nvm &> /dev/null); then
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
source ~/.nvm/nvm.sh
fi
if ! $(command -v bun &> /dev/null); then
curl -fsSL https://bun.sh/install | bash
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
fi
if ! $(command -v deno &> /dev/null); then
curl -fsSL https://deno.land/x/install/install.sh | sh
export DENO_INSTALL="$HOME/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
fi
for version in 16 17 18.15 18.16 20; do
nvm install $version --silent
done
npm install --ignore-scripts --no-audit --no-fund --silent
current_node_version=$(nvm current)
function cleanup {
echo "Restoring node version to $current_node_version"
nvm use $current_node_version
}
trap cleanup EXIT
# Clear terminal output
printf "\033c"
deno run -A bench_url.js
echo ""
bun run bench_url.js
echo ""
for version in 16 17 18.15 18.16 20; do
nvm use $version
node bench_url.js
echo ""
done