diff options
| -rwxr-xr-x | gist | 30 |
1 files changed, 15 insertions, 15 deletions
| @@ -302,21 +302,6 @@ _grep_content() { | |||
| 302 | done < $INDEX | 302 | done < $INDEX |
| 303 | } | 303 | } |
| 304 | 304 | ||
| 305 | # Open Github repository import page | ||
| 306 | _import_to_github() { | ||
| 307 | _gist_id "$1" || return 1 | ||
| 308 | echo put the folowing URL into web page: | ||
| 309 | echo -n "git@github.com:$GIST_ID.git" | ||
| 310 | python -mwebbrowser https://github.com/new/import | ||
| 311 | } | ||
| 312 | |||
| 313 | # Simply commit current changes and push to remote | ||
| 314 | _push_to_remote() { | ||
| 315 | _gist_id "$1" || return 1 | ||
| 316 | cd "$folder/$GIST_ID" && git add . \ | ||
| 317 | && git commit --allow-empty-message -m '' && git push origin master | ||
| 318 | } | ||
| 319 | |||
| 320 | # Parse JSON object of the result of gist fetch | 305 | # Parse JSON object of the result of gist fetch |
| 321 | _parse_gists() { | 306 | _parse_gists() { |
| 322 | _process_json ' | 307 | _process_json ' |
| @@ -513,6 +498,21 @@ _show_detail() { | |||
| 513 | fi | 498 | fi |
| 514 | } | 499 | } |
| 515 | 500 | ||
| 501 | # Open Github repository import page | ||
| 502 | _import_to_github() { | ||
| 503 | _gist_id "$1" || return 1 | ||
| 504 | echo put the folowing URL into web page: | ||
| 505 | echo -n "git@github.com:$GIST_ID.git" | ||
| 506 | python -mwebbrowser https://github.com/new/import | ||
| 507 | } | ||
| 508 | |||
| 509 | # Simply commit current changes and push to remote | ||
| 510 | _push_to_remote() { | ||
| 511 | _gist_id "$1" || return 1 | ||
| 512 | cd "$folder/$GIST_ID" && git add . \ | ||
| 513 | && git commit --allow-empty-message -m '' && git push origin master | ||
| 514 | } | ||
| 515 | |||
| 516 | # Set filename/description/permission for a new gist | 516 | # Set filename/description/permission for a new gist |
| 517 | _set_gist() { | 517 | _set_gist() { |
| 518 | files=() | 518 | files=() |