diff options
author | typebrook <typebrook@gmail.com> | 2020-01-29 10:53:11 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-01-29 10:53:11 +0800 |
commit | 7bf9eb1c113261a10dcd9e0cc0ea07822516ee30 (patch) | |
tree | 15960f5805d64de98526515c10cf528edda4c3e3 /scripts/gist | |
parent | 73d775c6369bb02c4dd091ce4424a22569276f18 (diff) |
update
Diffstat (limited to 'scripts/gist')
-rwxr-xr-x | scripts/gist | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/gist b/scripts/gist index 5de68c7..19ab6a6 100755 --- a/scripts/gist +++ b/scripts/gist | |||
@@ -195,8 +195,9 @@ _sync_repos() { | |||
195 | echo Everything is fine! | 195 | echo Everything is fine! |
196 | } | 196 | } |
197 | 197 | ||
198 | # get gist id from index files | ||
198 | _gist_id() { | 199 | _gist_id() { |
199 | GIST_ID=$(cat $index $starred 2> /dev/null | sed -n "/^$1 / p" | cut -d' ' -f2 | sed -E 's#.*/##') | 200 | GIST_ID=$( (grep -hs '' $index $starred || true) | sed -n "/^$1 / p" | cut -d' ' -f2 | sed -E 's#.*/##') |
200 | if [[ -z "$GIST_ID" ]]; then | 201 | if [[ -z "$GIST_ID" ]]; then |
201 | echo -e "Not a valid index: \e[31m$1\e[0m" | 202 | echo -e "Not a valid index: \e[31m$1\e[0m" |
202 | echo Use the index number in the first column instead: | 203 | echo Use the index number in the first column instead: |