From 8bd965f0c0fececdd156065be74bbd7999ff9eea Mon Sep 17 00:00:00 2001 From: typebrook Date: Fri, 31 Jan 2020 00:43:50 +0800 Subject: update --- scripts/gist | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts/gist') diff --git a/scripts/gist b/scripts/gist index feebfcc..84b6dc7 100755 --- a/scripts/gist +++ b/scripts/gist @@ -111,18 +111,19 @@ _ask_token() { } _apply_config() { + source $config if [[ ! -e $config ]] || [[ -z $user ]]; then echo 'Hi fellow! To access your gists, I need your Github username, also a personal token with scope which allows "gist"!' _ask_username _ask_token - elif [[ -z $token ]] && [[ $2 =~ ^(n|new|e|edit|D|delete)$ ]]; then + elif [[ -z $token ]] && [[ $1 =~ ^(n|new|e|edit|D|delete)$ ]]; then _ask_token fi source $config } -_apply_config +_apply_config "$@" auth_header="Authorization: token $token" -- cgit v1.2.3-70-g09d2