diff options
author | typebrook <typebrook@gmail.com> | 2020-03-19 17:59:21 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-03-20 20:05:45 +0800 |
commit | bd1224b96536121cba62097b0a19febe46ae14df (patch) | |
tree | b2db7106b656a985aa9c8146fe4f7575cf04281b | |
parent | f1ad5ae584ec7458f56927b0aaba5cf8c833cf64 (diff) |
Fix logic error with invalid index
-rwxr-xr-x | gist | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -525,8 +525,8 @@ _import_to_github() { | |||
525 | # Simply commit current changes and push to remote | 525 | # Simply commit current changes and push to remote |
526 | _push_to_remote() { | 526 | _push_to_remote() { |
527 | if [[ ! $(pwd) =~ ^$folder/[0-9a-z]+$ ]]; then | 527 | if [[ ! $(pwd) =~ ^$folder/[0-9a-z]+$ ]]; then |
528 | _gist_id "$1" | 528 | _gist_id "$1" || return 1 |
529 | cd "$folder/$GIST_ID" || return 1 | 529 | cd "$folder/$GIST_ID" |
530 | fi | 530 | fi |
531 | if [[ -n $(git status --short) ]]; then | 531 | if [[ -n $(git status --short) ]]; then |
532 | git add . && git commit -m 'update' | 532 | git add . && git commit -m 'update' |