forked from davidtodd/landmarks
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simple shell script to help check the differences between debug and non-debug versions, though can also be used to compare cross-browser differences too.
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/sh | ||
check_browser() { | ||
if [ "$1" != "firefox" ] && [ "$1" != "chrome" ] && [ "$1" != "opera" ] && [ "$1" != "edge" ]; then | ||
echo "'$1' is not a valid browser" | ||
exit 42 | ||
fi | ||
} | ||
|
||
compare() { | ||
echo "compare $1 with $2" | ||
git diff --no-index "build/script-cache/$1" "build/script-cache/$2" | ||
} | ||
|
||
echo "Usage:" | ||
echo " <browser> <browser>" | ||
echo " <browser> <browser> d" | ||
echo " <browser> d" | ||
echo | ||
echo "You may want to run the following first" | ||
echo " node scripts/build.js --browser all --debug" | ||
echo " node scripts/build.js --browser all" | ||
|
||
if [ ! "$1" ] || [ ! "$2" ]; then | ||
echo "Missing first or second arg" | ||
exit 42 | ||
fi | ||
|
||
if [ "$2" = 'd' ]; then | ||
check_browser "$1" | ||
compare "$1" "$1-debug" | ||
else | ||
check_browser "$1" | ||
check_browser "$2" | ||
if [ "$3" = 'd' ]; then | ||
compare "$1-debug" "$2-debug" | ||
else | ||
compare "$1" "$2" | ||
fi | ||
fi |