diff --git a/would-reformat.sh b/would-reformat.sh index 9f9f307..ce1e106 100755 --- a/would-reformat.sh +++ b/would-reformat.sh @@ -68,7 +68,7 @@ elif [[ $file_type == "dart" ]] ; then # probably others too :( syntax_error_retval=65 - out=$(dart format -o none --set-exit-if-changed $file) + out=$(dart format -o none --set-exit-if-changed "$file") exitval="$?" retval="$exitval" else @@ -77,13 +77,13 @@ else fi -if [[ x"$retval" == x"$success_retval" ]]; then +if [[ "$retval" == "$success_retval" ]]; then echo -n "would not change" exit 0 -elif [[ x"$retval" == x"$would_reformat_retval" ]]; then +elif [[ "$retval" == "$would_reformat_retval" ]]; then echo -n "would change" exit 1 -elif [[ x"$retval" == x"$syntax_error_retval" ]]; then +elif [[ "$retval" == "$syntax_error_retval" ]]; then echo -n "syntax error" echo echo "$out"