diff options
author | typebrook <typebrook@gmail.com> | 2020-01-31 00:43:50 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-01-31 00:43:50 +0800 |
commit | 8bd965f0c0fececdd156065be74bbd7999ff9eea (patch) | |
tree | 7cf4a54c0ac4063535e2cee5aa4f4c3f58df2270 /scripts/gist | |
parent | fdf8146cbc9ca09433352ca9c203fdb4ef7c1bf1 (diff) |
update
Diffstat (limited to 'scripts/gist')
-rwxr-xr-x | scripts/gist | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/gist b/scripts/gist index feebfcc..84b6dc7 100755 --- a/scripts/gist +++ b/scripts/gist | |||
@@ -111,18 +111,19 @@ _ask_token() { | |||
111 | } | 111 | } |
112 | 112 | ||
113 | _apply_config() { | 113 | _apply_config() { |
114 | source $config | ||
114 | if [[ ! -e $config ]] || [[ -z $user ]]; then | 115 | if [[ ! -e $config ]] || [[ -z $user ]]; then |
115 | echo 'Hi fellow! To access your gists, I need your Github username, also a personal token with scope which allows "gist"!' | 116 | echo 'Hi fellow! To access your gists, I need your Github username, also a personal token with scope which allows "gist"!' |
116 | _ask_username | 117 | _ask_username |
117 | _ask_token | 118 | _ask_token |
118 | elif [[ -z $token ]] && [[ $2 =~ ^(n|new|e|edit|D|delete)$ ]]; then | 119 | elif [[ -z $token ]] && [[ $1 =~ ^(n|new|e|edit|D|delete)$ ]]; then |
119 | _ask_token | 120 | _ask_token |
120 | fi | 121 | fi |
121 | 122 | ||
122 | source $config | 123 | source $config |
123 | } | 124 | } |
124 | 125 | ||
125 | _apply_config | 126 | _apply_config "$@" |
126 | 127 | ||
127 | auth_header="Authorization: token $token" | 128 | auth_header="Authorization: token $token" |
128 | 129 | ||