From 81f425f06133c2a2f26176fa946cc3eda614e41b Mon Sep 17 00:00:00 2001 From: typebrook Date: Thu, 12 Mar 2020 10:17:33 +0800 Subject: update --- gist | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gist b/gist index a405245..96231b9 100755 --- a/gist +++ b/gist @@ -18,7 +18,7 @@ # edit, e Edit a gist's description # delete, D ... Delete a gist # clean, C Clean removed gists in local -# config, c [token | user | folder | auto_sync | EDITOR | action | protocol [value] ] Do configuration +# config, c [token | user | folder | auto_sync | EDITOR | action | protocol ] Do configuration # user, U Get gists from a given Github user # grep, g Grep gists by a given pattern # push, p Push changes by git (well, better to make commit by youself) @@ -43,7 +43,6 @@ configuredClient="" GITHUB_API=https://api.github.com CONFIG=~/.config/gist.conf; mkdir -p ~/.config -folder=~/gist && mkdir -p $folder action="${EDITOR:-vi} ." [[ -z $hint ]] && hint=true # default to show hint with list of gist [[ -z $confirm ]] && confirm=true # default to confirm when deleting gists @@ -225,6 +224,8 @@ _validate_config(){ # load configuration _apply_config() { _validate_config "$@" || return 1 + + [[ -z $folder ]] && folder=~/gist; mkdir -p $folder INDEX=$folder/index; [[ -e $INDEX ]] || touch $INDEX } @@ -328,7 +329,7 @@ _fetch_gists() { local route="users/$user/gists" local filter='/^[^s]/ d; /^$/ d' if [[ $1 =~ ^(star|s)$ ]];then - route="gists/starred" + route='gists/starred' local mark="s" filter='/^[s]/ d; /^$/ d' fi -- cgit v1.2.3-70-g09d2