From 0b430e679b728c06f460bf15edd297d8d6dd142f Mon Sep 17 00:00:00 2001 From: typebrook Date: Tue, 28 Jan 2020 12:47:31 +0800 Subject: update --- scripts/gist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/gist') 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 _auth() { echo 'Hi fellow! To access your gists, I need your Github username and a personal token with scope which allows "gist"!' read -p "Github username: " user < /dev/tty - if [[ $new_token =~ ^[[:alnum:]]+$ ]]; then + if [[ $user =~ ^[[:alnum:]]+$ ]]; then mkdir -p ~/.config umask 0077 echo user=$user > $config @@ -290,7 +290,7 @@ _edit_gist() { echo -n 'Type new description: ' read DESC < /dev/tty - jq -n --arg DESC "$DESC" '{ description: ($DESC) }' \ + echo "{ \"description\": \"$DESC\" }" \ | curl -X PATCH -H "$auth_header" --data @- $github_api/gists/$GIST_ID > /dev/null \ && _update } -- cgit v1.2.3-70-g09d2