Last active
April 5, 2016 17:46
-
-
Save belchior/7296fbac65190a4cc0ce to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function gt | |
set mydir (pwd); | |
set www '/var/www/html'; | |
set untracked 'Untracked files'; | |
set notStaged 'Changes not staged'; | |
set toCommit 'Changes to be committed'; | |
set isAhead 'is ahead'; | |
set ok 'nothing to commit'; | |
cd $www; | |
clear; | |
printf "\ | |
_ _ _ _ \n\ | |
__ _(_) |_ ___| |_ __ _| |_ _ _ ___ \n\ | |
/ _` | | __| / __| __/ _` | __| | | / __|\n\ | |
| (_| | | |_ \\__ \\ || (_| | |_| |_| \\__ \ \n\ | |
\\__, |_|\\__| |___/\\__\\__,_|\\__|\\__,_|___/\n\ | |
|___/\ | |
"; | |
printf \n'# ----------------------------------------------------------------------- #'\n; | |
for dirname in (ls -dtr */); | |
cd $dirname; | |
if test -d .git; | |
printf "$PWD - "; | |
if test (git status | grep -o $untracked); | |
set_color yellow; | |
printf "$untracked "; | |
end | |
if test (git status | grep -o $notStaged); | |
set_color yellow; | |
printf "$notStaged "; | |
end | |
if test (git status | grep -o $toCommit); | |
set_color red; | |
printf "$toCommit "; | |
end | |
if test (git status | grep -o $isAhead); | |
set_color red; | |
printf "$isAhead "; | |
end | |
if test (git status | grep -o $ok); | |
set_color green; | |
printf "$ok "; | |
end | |
set_color normal; | |
printf \n; | |
end | |
cd $www; | |
end | |
printf '# ----------------------------------------------------------------------- #'\n\n; | |
cd $mydir; | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment