mirror of
https://github.com/vale981/tridactyl
synced 2025-03-04 17:11:40 -05:00
Fix {pretty,lint} when staging more than one file
This commit is contained in:
parent
bc2abbb812
commit
ad261b2e4f
2 changed files with 7 additions and 4 deletions
|
@ -7,9 +7,9 @@ cachedJS() {
|
|||
ugly() {
|
||||
local acc=()
|
||||
for jsfile in "$@"; do
|
||||
diff "$jsfile" <($(npm bin)/prettier "$jsfile") >/dev/null || acc+=("$jsfile")
|
||||
diff "$jsfile" <($(npm bin)/prettier $jsfile) >/dev/null || acc+=("$jsfile")
|
||||
done
|
||||
echo $acc
|
||||
echo ${acc[@]}
|
||||
}
|
||||
|
||||
noisy() {
|
||||
|
@ -19,5 +19,5 @@ noisy() {
|
|||
acc+=("jsfile")
|
||||
fi
|
||||
done
|
||||
echo $acc
|
||||
echo ${acc[@]}
|
||||
}
|
||||
|
|
|
@ -2,8 +2,11 @@
|
|||
|
||||
source ./scripts/common
|
||||
|
||||
set -e
|
||||
|
||||
uglyFiles=$(ugly $(cachedJS))
|
||||
|
||||
if [ -n "$uglyFiles" ]; then
|
||||
prettier --write "$uglyFiles"
|
||||
prettier --write $uglyFiles
|
||||
git add $uglyFiles
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue