Created
July 15, 2019 18:34
-
-
Save GlauberF/bc46aef3aa06e302084a2de6e6dc4cae to your computer and use it in GitHub Desktop.
prettier - Glauber Funez
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#instalar | |
#npm install --save-dev --save-exact prettier | |
#npm install @types/prettier --save-dev | |
#criar arquivos (.prettierrc) e (.prettierignore), exemplo (https://github.com/nrwl/nx) | |
read -p "Digite o nome da pasta do módulo, que deve ser verificada? " response | |
if [ "$response" != "" ]; then | |
echo | |
echo "$response - check Prettier ..." | |
echo | |
echo | |
./node_modules/.bin/prettier "**/$response/*.{ts,js,json,css,scss,md}" "!**/{__name__,__directory__}/**" --list-different | |
PRETTIER_STATUS=$? | |
#echo "Checking CRLF" | |
#find scripts -type f -exec file "{}" ";" | grep CRLF | |
#SCRIPTS_STATUS=$? | |
#find packages -type f -exec file "{}" ";" | grep CRLF | |
#PACKAGES_STATUS=$? | |
#if [[ $PRETTIER_STATUS -eq 1 || $SCRIPTS_STATUS -eq 0 || $PACKAGES_STATUS -eq 0 ]]; then | |
if [[ $PRETTIER_STATUS -eq 1 ]]; then | |
echo | |
echo "Por favor, rode o comando de formatação para o APP $response, isso irrá ajustar os arquivos mencionados acima"; | |
exit 1; | |
fi | |
else | |
echo "Não foi informado o nome do app!" | |
exit 1; | |
fi | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#instalar | |
#npm install --save-dev --save-exact prettier | |
#npm install @types/prettier --save-dev | |
#criar arquivos (.prettierrc) e (.prettierignore), exemplo (https://github.com/nrwl/nx) | |
echo | |
echo "check Prettier all ..." | |
echo | |
echo | |
./node_modules/.bin/prettier "**/*.{ts,js,json,css,scss,md}" "!**/{__name__,__directory__}/**" --list-different | |
PRETTIER_STATUS=$? | |
echo $PRETTIER_STATUS | |
#echo "Checking CRLF" | |
#find scripts -type f -exec file "{}" ";" | grep CRLF | |
#SCRIPTS_STATUS=$? | |
# | |
#find packages -type f -exec file "{}" ";" | grep CRLF | |
#PACKAGES_STATUS=$? | |
#if [[ $PRETTIER_STATUS -eq 1 || $SCRIPTS_STATUS -eq 0 || $PACKAGES_STATUS -eq 0 ]]; then | |
if [[ $PRETTIER_STATUS -eq 1 ]]; then | |
echo | |
echo "Por favor, rode o comando de formatação, para ajustar os arquivos acima"; | |
exit 1; | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#instalar | |
#npm install --save-dev --save-exact prettier | |
#npm install @types/prettier --save-dev | |
#criar arquivos (.prettierrc) e (.prettierignore), exemplo (https://github.com/nrwl/nx) | |
read -p "Digite o nome da pasta do módulo, que deve ser formatada? " response | |
if [ "$response" != "" ]; then | |
echo | |
echo "$response - Prettier ..." | |
echo | |
echo | |
./node_modules/.bin/prettier "**/$response/*.{ts,js,json,css,scss,md}" ".prettierignore*/{__name__,__directory__}/**" --write | |
else | |
echo "Não foi informado o nome do app!" | |
exit 1; | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#instalar | |
#npm install --save-dev --save-exact prettier | |
#npm install @types/prettier --save-dev | |
#criar arquivos (.prettierrc) e (.prettierignore), exemplo (https://github.com/nrwl/nx) | |
echo | |
echo "Prettier All ..." | |
echo | |
echo | |
./node_modules/.bin/prettier "**/*.{ts,js,json,css,scss,md}" ".prettierignore*/{__name__,__directory__}/**" --write |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment