diff options
author | typebrook <typebrook@gmail.com> | 2020-01-24 01:25:51 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-01-24 01:25:51 +0800 |
commit | 3883898d3cf09a2d4449a61fa4a7a56c671cb3da (patch) | |
tree | 3b752204a25bb02f17102bde44c029d3d566dee4 /scripts/gist | |
parent | 9b540adbbbbba6ac640e3049fe1cbfb7a9030a32 (diff) |
update
Diffstat (limited to 'scripts/gist')
-rwxr-xr-x | scripts/gist | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/gist b/scripts/gist index 0336b5f..e861aee 100755 --- a/scripts/gist +++ b/scripts/gist | |||
@@ -89,7 +89,7 @@ esac | |||
89 | github_api=https://api.github.com | 89 | github_api=https://api.github.com |
90 | auth_header="Authorization: token $token" | 90 | auth_header="Authorization: token $token" |
91 | 91 | ||
92 | [[ -z "$folder" ]] && folder=~/git/gist | 92 | [[ -z "$folder" ]] && folder=~/gist |
93 | mkdir -p $folder | 93 | mkdir -p $folder |
94 | index=$folder/index | 94 | index=$folder/index |
95 | starred=$folder/starred | 95 | starred=$folder/starred |
@@ -169,7 +169,7 @@ _sync_repos() { | |||
169 | } | 169 | } |
170 | 170 | ||
171 | _gist_id() { | 171 | _gist_id() { |
172 | GIST_ID=$(cat $index $starred | sed -n "/^$1 / p" | cut -d' ' -f2 | sed -E 's#.*/##') | 172 | GIST_ID=$(cat $index $starred 2> /dev/null | sed -n "/^$1 / p" | cut -d' ' -f2 | sed -E 's#.*/##') |
173 | if [[ -z "$GIST_ID" ]]; then | 173 | if [[ -z "$GIST_ID" ]]; then |
174 | echo -e "Not a valid index: \e[31m$1\e[0m" | 174 | echo -e "Not a valid index: \e[31m$1\e[0m" |
175 | echo Use the index number in the first column instead: | 175 | echo Use the index number in the first column instead: |