summaryrefslogtreecommitdiffhomepage
path: root/scripts/gist
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-01-24 01:25:51 +0800
committertypebrook <typebrook@gmail.com>2020-01-24 01:25:51 +0800
commit3883898d3cf09a2d4449a61fa4a7a56c671cb3da (patch)
tree3b752204a25bb02f17102bde44c029d3d566dee4 /scripts/gist
parent9b540adbbbbba6ac640e3049fe1cbfb7a9030a32 (diff)
update
Diffstat (limited to 'scripts/gist')
-rwxr-xr-xscripts/gist4
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
89github_api=https://api.github.com 89github_api=https://api.github.com
90auth_header="Authorization: token $token" 90auth_header="Authorization: token $token"
91 91
92[[ -z "$folder" ]] && folder=~/git/gist 92[[ -z "$folder" ]] && folder=~/gist
93mkdir -p $folder 93mkdir -p $folder
94index=$folder/index 94index=$folder/index
95starred=$folder/starred 95starred=$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: