diff options
| -rwxr-xr-x | gist | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -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 | ||