From 8626dcb17701eeab8314ec092b9b520ccd2a072e Mon Sep 17 00:00:00 2001 From: typebrook Date: Sun, 17 May 2020 22:44:35 +0800 Subject: Fix logic error when getting id --- gist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gist b/gist index 2c16c50..edf8452 100755 --- a/gist +++ b/gist @@ -505,7 +505,7 @@ _repo_url() { # Get gist id from index files _gist_id() { - read -r ${INDEX_FORMAT[@]} <<<"$(sed -ne "/$1 / p" $INDEX)" + read -r ${INDEX_FORMAT[@]} <<<"$(sed -ne "/^$1 / p" $INDEX)" GIST_ID=${url##*/} if [[ -z $GIST_ID || ! $1 =~ [0-9a-z]+ ]]; then echo -e "$(hint=false _show_list | sed -Ee 's/^( *[0-9a-z]+)/\\e[5m\1\\e[0m/')" -- cgit v1.2.3-70-g09d2