diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/gist | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/gist b/scripts/gist index 2f99b23..1e9cf8e 100755 --- a/scripts/gist +++ b/scripts/gist | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | # https://gist.github.com/typebrook/b0d2e7e67aa50298fdf8111ae7466b56 | 5 | # https://gist.github.com/typebrook/b0d2e7e67aa50298fdf8111ae7466b56 |
| 6 | # | 6 | # |
| 7 | # | 7 | # |
| 8 | # This script host your gists as local Github repo | 8 | # This script host your gists as local cloned git repo |
| 9 | # It works under GNU with jq and curl, both are easy to get in most cases | 9 | # It works under GNU with jq and curl, both are easy to get in most cases |
| 10 | # | 10 | # |
| 11 | # Use the following commands to manage your gists: | 11 | # Use the following commands to manage your gists: |
| @@ -127,6 +127,7 @@ _sync_repos() { | |||
| 127 | echo Everything is fine! | 127 | echo Everything is fine! |
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | # TODO simplify | ||
| 130 | _gist_id() { | 131 | _gist_id() { |
| 131 | list_file=$index | 132 | list_file=$index |
| 132 | row_num=$1 | 133 | row_num=$1 |
| @@ -175,6 +176,7 @@ _show_detail() { | |||
| 175 | } | 176 | } |
| 176 | 177 | ||
| 177 | # create a new gist with files | 178 | # create a new gist with files |
| 179 | # FIXME consider file not exist -> let user type? return 1? | ||
| 178 | _create_gist() { | 180 | _create_gist() { |
| 179 | echo -n 'description: ' | 181 | echo -n 'description: ' |
| 180 | read DESC | 182 | read DESC |
| @@ -213,7 +215,7 @@ case "$1" in | |||
| 213 | "") | 215 | "") |
| 214 | _show_list | 216 | _show_list |
| 215 | ;; | 217 | ;; |
| 216 | create | c) | 218 | new | n) |
| 217 | shift; | 219 | shift; |
| 218 | _create_gist $@ | 220 | _create_gist $@ |
| 219 | ;; | 221 | ;; |