summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-02-04 13:10:13 +0800
committertypebrook <typebrook@gmail.com>2020-02-04 13:10:13 +0800
commitb12e63ae39f92254fd294d21e177bef88d0fe054 (patch)
tree29ecf7233ab8275c7017b67eb6f90552aef114ef
parenta6400d7fef9131e50c729697fe8da9512099313a (diff)
update
-rwxr-xr-xscripts/gist8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/gist b/scripts/gist
index 5424389..b6e2df0 100755
--- a/scripts/gist
+++ b/scripts/gist
@@ -140,14 +140,14 @@ _apply_config() {
140 _validate_config "$@" || return 1 140 _validate_config "$@" || return 1
141 141
142 AUTH_HEADER="Authorization: token $token" 142 AUTH_HEADER="Authorization: token $token"
143 [[ -z "$action" ]] && action="${EDITOR:-vi} *" 143 [[ -z "$action" ]] && action="${EDITOR:-vi} ."
144 [[ -z "$folder" ]] && folder=~/gist && mkdir -p $folder 144 [[ -z "$folder" ]] && folder=~/gist && mkdir -p $folder
145 INDEX=$folder/index 145 INDEX=$folder/index
146} 146}
147 147
148_apply_config "$@" || exit 1 148_apply_config "$@" || exit 1
149 149
150## This function determines which http get tool the system has installed and returns an error if there isnt one 150# This function determines which http get tool the system has installed and returns an error if there isnt one
151getConfiguredClient() { 151getConfiguredClient() {
152 if command -v curl &>/dev/null; then 152 if command -v curl &>/dev/null; then
153 configuredClient="curl" 153 configuredClient="curl"
@@ -163,7 +163,7 @@ getConfiguredClient() {
163 fi 163 fi
164} 164}
165 165
166## Allows to call the users configured client without if statements everywhere 166# Allows to call the users configured client without if statements everywhere
167http_method() { 167http_method() {
168 local METHOD=$1; shift 168 local METHOD=$1; shift
169 case "$configuredClient" in 169 case "$configuredClient" in
@@ -204,7 +204,7 @@ _show_list() {
204 # if there is a commit not yet push, show red message "ahead" 204 # if there is a commit not yet push, show red message "ahead"
205 [[ -n $(cd $repo && git cherry) ]] 2>/dev/null && extra="\e[31m[ahead]\e[0m" && occupy=7 205 [[ -n $(cd $repo && git cherry) ]] 2>/dev/null && extra="\e[31m[ahead]\e[0m" && occupy=7
206 206
207 echo $index $link $file_num $extra $(echo $description | cut -c -$(( 60 -$occupy -1 )) ) 207 echo -e $index $link $file_num $extra $(echo $description | cut -c -$(( 60 -$occupy -1 )) )
208 done < $INDEX \ 208 done < $INDEX \
209 | sed "$filter" 209 | sed "$filter"
210} 210}