forked from Schniz/fnm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun
executable file
·36 lines (28 loc) · 871 Bytes
/
run
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
#!/bin/bash
set -e
export FNM_DIR
BASE_DIR="$(dirname "$(realpath "$0")")"
cd "$BASE_DIR" || exit 1
FNM_DIR="$(mktemp -d)"
export PATH="$BASE_DIR/../target/release:$PATH"
mkdir results 2>/dev/null || :
if [ ! -f "$BASE_DIR/../target/release/fnm" ]; then
echo "Can't access the release version of fnm.rs"
exit 1
fi
if ! command -v hyperfine >/dev/null 2>&1; then
echo "Can't access Hyperfine. Are you sure it is installed?"
echo " if not, visit https://github.com/sharkdp/hyperfine"
exit 1
fi
# Running it with warmup means we're going to have the versions
# pre-installed. I think it is good because you open your shell more times
# than you install Node versions.
hyperfine \
--warmup=2 \
--min-runs=40 \
--time-unit=millisecond \
--export-json="./results/basic.json" \
--export-markdown="./results/basic.md" \
"basic/nvm" \
"basic/fnm"