From 71ab694bb824f0b3305f72ce14e3f30826bb7250 Mon Sep 17 00:00:00 2001 From: typebrook Date: Tue, 17 Mar 2020 09:15:49 +0800 Subject: Refactor code for order of functions --- gist | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/gist b/gist index a593f27..df3c631 100755 --- a/gist +++ b/gist @@ -302,21 +302,6 @@ _grep_content() { done < $INDEX } -# Open Github repository import page -_import_to_github() { - _gist_id "$1" || return 1 - echo put the folowing URL into web page: - echo -n "git@github.com:$GIST_ID.git" - python -mwebbrowser https://github.com/new/import -} - -# Simply commit current changes and push to remote -_push_to_remote() { - _gist_id "$1" || return 1 - cd "$folder/$GIST_ID" && git add . \ - && git commit --allow-empty-message -m '' && git push origin master -} - # Parse JSON object of the result of gist fetch _parse_gists() { _process_json ' @@ -513,6 +498,21 @@ _show_detail() { fi } +# Open Github repository import page +_import_to_github() { + _gist_id "$1" || return 1 + echo put the folowing URL into web page: + echo -n "git@github.com:$GIST_ID.git" + python -mwebbrowser https://github.com/new/import +} + +# Simply commit current changes and push to remote +_push_to_remote() { + _gist_id "$1" || return 1 + cd "$folder/$GIST_ID" && git add . \ + && git commit --allow-empty-message -m '' && git push origin master +} + # Set filename/description/permission for a new gist _set_gist() { files=() -- cgit v1.2.3-70-g09d2