diff options
author | typebrook <typebrook@gmail.com> | 2020-05-19 16:29:26 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-05-19 16:29:26 +0800 |
commit | 1b00a9cacf289a94f1fc9e5a1035c74c242dd23d (patch) | |
tree | 7429816885a6168fdd1a250720b0d9ad1882fd24 | |
parent | 194ef59eb10875e4843b826584480676dd142a8b (diff) |
Fix 'push' command
-rwxr-xr-x | gist | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -623,16 +623,16 @@ _export_to_github() { | |||
623 | 623 | ||
624 | # Simply commit current changes and push to remote | 624 | # Simply commit current changes and push to remote |
625 | _push_to_remote() { | 625 | _push_to_remote() { |
626 | if [[ ! $(pwd) =~ ^$folder/[0-9a-z]+$ ]]; then | 626 | _set_gist_id $1 || return 1 |
627 | _gist_id "$1" || return 1 | 627 | cd "$folder/$GIST_ID" |
628 | cd "$folder/$GIST_ID" | 628 | |
629 | fi | ||
630 | if [[ -n $(git status --short) ]]; then | 629 | if [[ -n $(git status --short) ]]; then |
631 | git add . && git commit -m 'update' | 630 | git add . && git commit -m 'update' |
632 | fi | 631 | fi |
633 | if [[ -n $(git cherry) ]]; then | 632 | if [[ -n $(git cherry) ]]; then |
634 | git push origin master && \ | 633 | git push origin master && \ |
635 | (http_method GET "$GITHUB_API/gists/$GIST_ID" | _update_gist $1 &> /dev/null &) | 634 | http_method GET "$GITHUB_API/gists/$GIST_ID" | _update_gist $1 |
635 | # FIXME $1 might be empty | ||
636 | fi | 636 | fi |
637 | } | 637 | } |
638 | 638 | ||