From db63a5fa1a29aaec7ac036b0a10495777ac04fa9 Mon Sep 17 00:00:00 2001 From: Ethan Soergel Date: Thu, 19 Dec 2024 14:52:36 -0500 Subject: [PATCH] Make prettify-changed script handle multi-lines The git command outputs each filename on its own line, and passing that to `prettier` fails. Instead, using `xargs` seems to do the trick --- scripts/prettify-changed.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/prettify-changed.sh b/scripts/prettify-changed.sh index 0c73ceec97ed..5ef770065321 100755 --- a/scripts/prettify-changed.sh +++ b/scripts/prettify-changed.sh @@ -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 }