further improvements
This commit is contained in:
24
compare.sh
Normal file
24
compare.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage: $(basename "$0") <branch>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
compareWith="$1"
|
||||
currentBranch="$(git branch --show-current)"
|
||||
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
echo "$currentBranch is not clean, please stash or commit your changes!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
hyperfine \
|
||||
-w 5 \
|
||||
-c "git checkout $currentBranch" \
|
||||
-p "make build" \
|
||||
-p "git checkout $compareWith; make build" \
|
||||
-n "$currentBranch" \
|
||||
-n "$compareWith" \
|
||||
'./monkey examples/fib.monkey' \
|
||||
'./monkey examples/fib.monkey'
|
||||
Reference in New Issue
Block a user