diff options
author | typebrook <typebrook@gmail.com> | 2020-01-16 15:48:48 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-01-16 15:48:48 +0800 |
commit | 3940d7b9301e0ca548fecdb424adb2e033d10342 (patch) | |
tree | 30b65835fbc17dae5c471150014b5ba7ac1023f1 /scripts | |
parent | 523a59350bf9b85e757986cb84263c0a87b3c83c (diff) |
update
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/gist | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/gist b/scripts/gist index 5248279..5301df3 100755 --- a/scripts/gist +++ b/scripts/gist | |||
@@ -63,10 +63,13 @@ _show_list() { | |||
63 | cat $index |\ | 63 | cat $index |\ |
64 | while read line_num link file_url_array file_num extra description; do | 64 | while read line_num link file_url_array file_num extra description; do |
65 | repo=$folder/$(echo $link | sed 's#.*/##') | 65 | repo=$folder/$(echo $link | sed 's#.*/##') |
66 | # if repo is not yet cloned, show green message "syncing" | ||
66 | cd $repo 2>/dev/null || extra="\e[32m[syncing]\e[0m" | 67 | cd $repo 2>/dev/null || extra="\e[32m[syncing]\e[0m" |
67 | # if there is something need to commit | 68 | # if there is something need to commit, show blue message "working" |
68 | [[ -n $(git status --short) ]] && extra="\e[36m[working]\e[0m" 2>/dev/null | 69 | [[ -n $(git status --short) ]] && extra="\e[36m[working]\e[0m" 2>/dev/null |
70 | # if there is commit need to push, show red message "head" | ||
69 | [[ -n $(git cherry) ]] && extra="\e[31m[ahead]\e[0m" 2>/dev/null | 71 | [[ -n $(git cherry) ]] && extra="\e[31m[ahead]\e[0m" 2>/dev/null |
72 | |||
70 | echo -e $line_num $link $file_num $extra $description | 73 | echo -e $line_num $link $file_num $extra $description |
71 | done | 74 | done |
72 | } | 75 | } |