Skip to content

Commit

Permalink
Make prettify-changed script handle multi-lines
Browse files Browse the repository at this point in the history
The git command outputs each filename on its own line, and passing that
to `prettier` fails.  Instead, using `xargs` seems to do the trick
  • Loading branch information
esoergel committed Dec 19, 2024
1 parent cff42bb commit db63a5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/prettify-changed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ get_changed() {
prettify() {
FILES=$1
echo "Formatting files changed on this branch:"
./node_modules/.bin/prettier --write "$FILES"
echo "$FILES" | xargs ./node_modules/.bin/prettier --write
echo
}

Expand Down

0 comments on commit db63a5f

Please sign in to comment.