mirror of
https://github.com/chinchang/web-maker.git
synced 2025-08-02 03:20:15 +02:00
add prettier for css n md source files
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# RUN PRETTIER
|
# RUN PRETTIER
|
||||||
jsjsonfiles=$(git diff --staged --name-only | grep ".*\.\(js\|json\)")
|
filesToPrettify=$(git diff --staged --name-only | grep ".*\.\(js\|json\|css\|md\)")
|
||||||
echo "$jsjsonfiles" | xargs ./node_modules/.bin/prettier --single-quote --use-tabs --write
|
echo "$fileToPrettify" | xargs ./node_modules/.bin/prettier --single-quote --use-tabs --write
|
||||||
echo "$jsjsonfiles" | xargs git add
|
echo "$fileToPrettify" | xargs git add
|
||||||
|
|
||||||
# Fetch .js or .json filed from staged files
|
# Fetch .js or .json filed from staged files
|
||||||
jsfiles=$(git diff --staged --name-only --diff-filter=ACM | grep '\.js$')
|
jsfiles=$(git diff --staged --name-only --diff-filter=ACM | grep '\.js$')
|
||||||
|
Reference in New Issue
Block a user