aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-03-12 10:41:27 +0800
committertypebrook <typebrook@gmail.com>2020-03-12 10:41:27 +0800
commit0fbccd2de45bad4bdf46326a0005c2fa563750df (patch)
tree2a50ea028e6312d82face292b44b439c3affd32f
parent541211f8a4c39de4e11c40790a38ebdc8fe9d0ba (diff)
update
-rwxr-xr-xgist5
1 files changed, 3 insertions, 2 deletions
diff --git a/gist b/gist
index ce1fd41..b303612 100755
--- a/gist
+++ b/gist
@@ -18,7 +18,7 @@
18# edit, e <index_of_gist> Edit a gist's description 18# edit, e <index_of_gist> Edit a gist's description
19# delete, D <index_of_gist>... Delete a gist 19# delete, D <index_of_gist>... Delete a gist
20# clean, C Clean removed gists in local 20# clean, C Clean removed gists in local
21# config, c [token | user | folder | auto_sync | EDITOR | action | protocol <value> ] Do configuration 21# config, c [token | user | folder | auto_sync | EDITOR | action | protocol [value] ] Do configuration
22# user, U <user> Get gists from a given Github user 22# user, U <user> Get gists from a given Github user
23# grep, g <pattern> Grep gists by a given pattern 23# grep, g <pattern> Grep gists by a given pattern
24# push, p <index_of_gist> Push changes by git (well, better to make commit by youself) 24# push, p <index_of_gist> Push changes by git (well, better to make commit by youself)
@@ -227,7 +227,8 @@ _validate_config(){
227_apply_config() { 227_apply_config() {
228 _validate_config "$@" || return 1 228 _validate_config "$@" || return 1
229 229
230 [[ -z $folder ]] && folder=~/gist; mkdir -p $folder 230 [[ -z $folder || ! -w $(dirname $folder) ]] && folder=~/gist
231 mkdir -p $folder
231 INDEX=$folder/index; [[ -e $INDEX ]] || touch $INDEX 232 INDEX=$folder/index; [[ -e $INDEX ]] || touch $INDEX
232} 233}
233 234