Last active
August 29, 2015 13:57
-
-
Save voyeg3r/9646346 to your computer and use it in GitHub Desktop.
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
#!/bin/env bash | |
# source: DEV WITH PASSION --> http://va.mu/eVRT | |
# purpose: indet files with vim | |
cd diretorio/com/arquivos/a/serem/indentados | |
find -type f | egrep ".html$|.php$|.inc$|.tpl$" > lista_arquivos | |
for arquivo in $( < lista_arquivos ); | |
do | |
echo "$(date +'%d/%m/%Y %H:%M:%S') - iniciando indentação de '$arquivo'" >> log_indentacao | |
vim -c ":normal gg=G" -c :w! -c :q! ---- $arquivo && | |
echo "$(date +'%d/%m/%Y %H:%M:%S') - finalizando indentação de '$arquivo'" >> log_indentacao || | |
echo "$(date +'%d/%m/%Y %H:%M:%S') - falhou indentação de '$arquivo'" >> log_indentacao | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment