diff options
| author | typebrook <typebrook@gmail.com> | 2020-01-31 17:20:11 +0800 |
|---|---|---|
| committer | typebrook <typebrook@gmail.com> | 2020-01-31 17:20:11 +0800 |
| commit | 62e700ed8b84b5cb43809fe22514f5298ecdb8c1 (patch) | |
| tree | 89137463a0951585b5e6c4e166d74b6ceb5015eb | |
| parent | fc0a96ce11b1c82d62ca3714c27e12f78288da1f (diff) | |
update
| -rwxr-xr-x | scripts/gist | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/gist b/scripts/gist index 892cdac..4b7ef0c 100755 --- a/scripts/gist +++ b/scripts/gist | |||
| @@ -52,8 +52,8 @@ | |||
| 52 | # gist (help | h) | 52 | # gist (help | h) |
| 53 | 53 | ||
| 54 | # TODO parallel branch works with wget and other stuff | 54 | # TODO parallel branch works with wget and other stuff |
| 55 | # TODO unify indent | ||
| 56 | # TODO grep mode for description, file content | 55 | # TODO grep mode for description, file content |
| 56 | # TODO push github.com (may need new token) | ||
| 57 | # TODO description for current directory | 57 | # TODO description for current directory |
| 58 | # TODO error handling, unit test | 58 | # TODO error handling, unit test |
| 59 | # TODO completion | 59 | # TODO completion |
| @@ -98,11 +98,12 @@ _ask_username() { | |||
| 98 | _configure user $user | 98 | _configure user $user |
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | # TODO token check, ref: https://developer.github.com/v3/apps/oauth_applications/#check-a-token | ||
| 101 | _ask_token() { | 102 | _ask_token() { |
| 102 | echo -n "Create a new token from web browser? [Y/n] " | 103 | echo -n "Create a new token from web browser? [Y/n] " |
| 103 | read answer < /dev/tty | 104 | read answer < /dev/tty |
| 104 | if [[ ! $answer =~ ^(N|n|No|NO|no)$ ]]; then | 105 | if [[ ! $answer =~ ^(N|n|No|NO|no)$ ]]; then |
| 105 | python -mwebbrowser https://github.com/settings/tokens/new\?scopes\=gist; | 106 | python -mwebbrowser https://github.com/settings/tokens/new\?scopes\=gist |
| 106 | fi | 107 | fi |
| 107 | 108 | ||
| 108 | while [[ ! $token =~ ^[[:alnum:]]{40}$ ]]; do | 109 | while [[ ! $token =~ ^[[:alnum:]]{40}$ ]]; do |