summaryrefslogtreecommitdiffhomepage
path: root/scripts/gist
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-01-29 10:53:11 +0800
committertypebrook <typebrook@gmail.com>2020-01-29 10:53:11 +0800
commit7bf9eb1c113261a10dcd9e0cc0ea07822516ee30 (patch)
tree15960f5805d64de98526515c10cf528edda4c3e3 /scripts/gist
parent73d775c6369bb02c4dd091ce4424a22569276f18 (diff)
update
Diffstat (limited to 'scripts/gist')
-rwxr-xr-xscripts/gist3
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: