From ce5ee2bf1b3571f6e2bd14996ecc78f364794d22 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Fri, 3 Jul 2020 09:26:20 +0800 Subject: Fix sub-command 'gist pin' --- gist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gist b/gist index 7910439..34158f2 100755 --- a/gist +++ b/gist @@ -65,7 +65,7 @@ declare -r CONFIG=~/.config/gist.conf; mkdir -p ~/.config declare -r per_page=100 declare -ar INDEX_FORMAT=('index' 'public' 'gist_id' 'tags_string' 'blob_code' 'file_array' 'file_num' 'comment_num' 'author' 'created_at' 'updated_at' 'description') -declare -ar VALID_CONFIGS=('user' 'token' 'folder' 'auto_sync' 'action' 'EDITOR' 'protocol' 'show_untagged') +declare -ar VALID_CONFIGS=('user' 'token' 'folder' 'auto_sync' 'action' 'EDITOR' 'protocol' 'show_untagged' 'pin') declare -A CONFIG_VALUES CONFIG_VALUES[auto_sync]='true|false' CONFIG_VALUES[protocol]='https|ssh' @@ -222,7 +222,7 @@ _reformat_config() { local value="${!key}"; local valid_values=${CONFIG_VALUES[$key]} if [[ -n "$value" ]] && [[ -z $valid_values || "$value" =~ ^($valid_values)$ ]]; then echo -n $key="'$value'" - declare -g $key=$value # apply current value + declare -g $key="$value" # apply current value else echo -n $key= declare -g $key=${valid_values%%|*} # apply the first valid value -- cgit v1.2.3-70-g09d2