From bd1224b96536121cba62097b0a19febe46ae14df Mon Sep 17 00:00:00 2001 From: typebrook Date: Thu, 19 Mar 2020 17:59:21 +0800 Subject: Fix logic error with invalid index --- gist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gist b/gist index 5f64513..e2c6f79 100755 --- a/gist +++ b/gist @@ -525,8 +525,8 @@ _import_to_github() { # Simply commit current changes and push to remote _push_to_remote() { if [[ ! $(pwd) =~ ^$folder/[0-9a-z]+$ ]]; then - _gist_id "$1" - cd "$folder/$GIST_ID" || return 1 + _gist_id "$1" || return 1 + cd "$folder/$GIST_ID" fi if [[ -n $(git status --short) ]]; then git add . && git commit -m 'update' -- cgit v1.2.3-70-g09d2