diff options
author | typebrook <typebrook@gmail.com> | 2020-05-17 22:44:35 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-05-17 22:44:35 +0800 |
commit | 8626dcb17701eeab8314ec092b9b520ccd2a072e (patch) | |
tree | fd9b4b8a93232aa9170d2ad53ba5963c6d660932 | |
parent | 48b54e7151e177a12f218db723f491ff5b1a68f9 (diff) |
Fix logic error when getting id
-rwxr-xr-x | gist | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -505,7 +505,7 @@ _repo_url() { | |||
505 | 505 | ||
506 | # Get gist id from index files | 506 | # Get gist id from index files |
507 | _gist_id() { | 507 | _gist_id() { |
508 | read -r ${INDEX_FORMAT[@]} <<<"$(sed -ne "/$1 / p" $INDEX)" | 508 | read -r ${INDEX_FORMAT[@]} <<<"$(sed -ne "/^$1 / p" $INDEX)" |
509 | GIST_ID=${url##*/} | 509 | GIST_ID=${url##*/} |
510 | if [[ -z $GIST_ID || ! $1 =~ [0-9a-z]+ ]]; then | 510 | if [[ -z $GIST_ID || ! $1 =~ [0-9a-z]+ ]]; then |
511 | echo -e "$(hint=false _show_list | sed -Ee 's/^( *[0-9a-z]+)/\\e[5m\1\\e[0m/')" | 511 | echo -e "$(hint=false _show_list | sed -Ee 's/^( *[0-9a-z]+)/\\e[5m\1\\e[0m/')" |