1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-08-01 19:10:22 +02:00

add prettier for css n md source files

This commit is contained in:
Kushagra Gour
2018-01-13 12:24:27 +05:30
parent 3a23861711
commit aa9201aef5

View File

@@ -1,9 +1,9 @@
#!/bin/sh
# RUN PRETTIER
jsjsonfiles=$(git diff --staged --name-only | grep ".*\.\(js\|json\)")
echo "$jsjsonfiles" | xargs ./node_modules/.bin/prettier --single-quote --use-tabs --write
echo "$jsjsonfiles" | xargs git add
filesToPrettify=$(git diff --staged --name-only | grep ".*\.\(js\|json\|css\|md\)")
echo "$fileToPrettify" | xargs ./node_modules/.bin/prettier --single-quote --use-tabs --write
echo "$fileToPrettify" | xargs git add
# Fetch .js or .json filed from staged files
jsfiles=$(git diff --staged --name-only --diff-filter=ACM | grep '\.js$')