diff options
| -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 | ||