diff options
author | typebrook <typebrook@gmail.com> | 2020-01-28 12:47:31 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-01-28 12:47:31 +0800 |
commit | 0b430e679b728c06f460bf15edd297d8d6dd142f (patch) | |
tree | f2f18e0f04680afe86a13f19f130ef4cce94bf4a /scripts | |
parent | 9aa7980cb97d6ec13b86d670386ac70c05e5358b (diff) |
update
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/gist | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/gist b/scripts/gist index fe839a3..b82fa0a 100755 --- a/scripts/gist +++ b/scripts/gist | |||
@@ -65,7 +65,7 @@ set -eo pipefail | |||
65 | _auth() { | 65 | _auth() { |
66 | echo 'Hi fellow! To access your gists, I need your Github username and a personal token with scope which allows "gist"!' | 66 | echo 'Hi fellow! To access your gists, I need your Github username and a personal token with scope which allows "gist"!' |
67 | read -p "Github username: " user < /dev/tty | 67 | read -p "Github username: " user < /dev/tty |
68 | if [[ $new_token =~ ^[[:alnum:]]+$ ]]; then | 68 | if [[ $user =~ ^[[:alnum:]]+$ ]]; then |
69 | mkdir -p ~/.config | 69 | mkdir -p ~/.config |
70 | umask 0077 | 70 | umask 0077 |
71 | echo user=$user > $config | 71 | echo user=$user > $config |
@@ -290,7 +290,7 @@ _edit_gist() { | |||
290 | 290 | ||
291 | echo -n 'Type new description: ' | 291 | echo -n 'Type new description: ' |
292 | read DESC < /dev/tty | 292 | read DESC < /dev/tty |
293 | jq -n --arg DESC "$DESC" '{ description: ($DESC) }' \ | 293 | echo "{ \"description\": \"$DESC\" }" \ |
294 | | curl -X PATCH -H "$auth_header" --data @- $github_api/gists/$GIST_ID > /dev/null \ | 294 | | curl -X PATCH -H "$auth_header" --data @- $github_api/gists/$GIST_ID > /dev/null \ |
295 | && _update | 295 | && _update |
296 | } | 296 | } |