From 3883898d3cf09a2d4449a61fa4a7a56c671cb3da Mon Sep 17 00:00:00 2001 From: typebrook Date: Fri, 24 Jan 2020 01:25:51 +0800 Subject: update --- scripts/gist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/gist') diff --git a/scripts/gist b/scripts/gist index 0336b5f..e861aee 100755 --- a/scripts/gist +++ b/scripts/gist @@ -89,7 +89,7 @@ esac github_api=https://api.github.com auth_header="Authorization: token $token" -[[ -z "$folder" ]] && folder=~/git/gist +[[ -z "$folder" ]] && folder=~/gist mkdir -p $folder index=$folder/index starred=$folder/starred @@ -169,7 +169,7 @@ _sync_repos() { } _gist_id() { - GIST_ID=$(cat $index $starred | sed -n "/^$1 / p" | cut -d' ' -f2 | sed -E 's#.*/##') + GIST_ID=$(cat $index $starred 2> /dev/null | sed -n "/^$1 / p" | cut -d' ' -f2 | sed -E 's#.*/##') if [[ -z "$GIST_ID" ]]; then echo -e "Not a valid index: \e[31m$1\e[0m" echo Use the index number in the first column instead: -- cgit v1.2.3-70-g09d2