aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-01-27 21:33:10 +0800
committertypebrook <typebrook@gmail.com>2020-01-27 21:33:10 +0800
commit71845f9c802cdffe22f4c07be54b1caf9c230df3 (patch)
tree1c837647bcd57edf8b199c705338168f7388898a
parent73dcb99f28f22ea776c613deb7ee9b0b64d19854 (diff)
update
-rwxr-xr-xscripts/gist7
1 files changed, 3 insertions, 4 deletions
diff --git a/scripts/gist b/scripts/gist
index 3cb53f5..72601ae 100755
--- a/scripts/gist
+++ b/scripts/gist
@@ -110,9 +110,8 @@ _show_list() {
110 | while read line_num link file_url_array file_num extra description; do 110 | while read line_num link file_url_array file_num extra description; do
111 local repo=$folder/$(echo $link | sed 's#.*/##') 111 local repo=$folder/$(echo $link | sed 's#.*/##')
112 112
113 # if repo is not yet cloned, show green message "Sync Now" 113 # if repo is not yet cloned, show green message "Not cloned yet"
114 # FIXME 114 [[ ! -d $repo ]] && extra="\e[32m[Not cloned yet]\e[0m"
115 [[ ! -d $repo ]] && extra="\e[32m[Sync Now]\e[0m"
116 # if there are some changes in git index or working directory, show blue message "working" 115 # if there are some changes in git index or working directory, show blue message "working"
117 [[ -n $(git status --short) ]] 2>/dev/null && extra="\e[36m[working]\e[0m" 116 [[ -n $(git status --short) ]] 2>/dev/null && extra="\e[36m[working]\e[0m"
118 # if there is a commit not yet push, show red message "ahead" 117 # if there is a commit not yet push, show red message "ahead"
@@ -123,7 +122,6 @@ _show_list() {
123} 122}
124 123
125# get the list of gists 124# get the list of gists
126# TODO support secret gist
127_update() { 125_update() {
128 echo "fetching from api.github.com..." 126 echo "fetching from api.github.com..."
129 echo 127 echo
@@ -252,6 +250,7 @@ _new_file() {
252 250
253# create a new gist with files 251# create a new gist with files
254# FIXME error handling if gist is not created, file doesn't exist 252# FIXME error handling if gist is not created, file doesn't exist
253# TODO support secret gist
255_create_gist() { 254_create_gist() {
256 _set_gist "$@" 255 _set_gist "$@"
257 [[ -z "$files" ]] && files=$(_new_file $filename) 256 [[ -z "$files" ]] && files=$(_new_file $filename)