swc/crates/swc_ecma_codegen/scripts/compare-file.sh
2021-11-10 19:00:54 +09:00

19 lines
294 B
Bash
Executable File

#!/usr/bin/env bash
set -eu
echo ''
echo ''
echo ''
echo "Comparing $1"
EXPECTED=$(terser "$1" | xargs)
ACTUAL=$(cat "$1" | xargs)
if [[ $EXPECTED == $ACTUAL || $EXPECTED == "$ACTUAL;" ]]; then
echo "PASSED";
git add "$1"
else
echo $EXPECTED
echo $ACTUAL
echo "FAILED"
fi