From 15b93348a5599a90ddcd533b4eeefac04a36e76c Mon Sep 17 00:00:00 2001 From: typebrook Date: Tue, 21 Jan 2020 16:27:51 +0800 Subject: update --- scripts/gist | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/gist b/scripts/gist index 3b98c24..5fd5bbf 100755 --- a/scripts/gist +++ b/scripts/gist @@ -95,7 +95,7 @@ starred=$folder/starred # Show the list of gist, but not updated time # TODO show git status outdated _show_list() { - if [[ ! -e $1 ]]; then + if [[ ! -e "$1" ]]; then echo No local file found for last update echo Please run command: echo " gist update" @@ -167,7 +167,7 @@ _sync_repos() { _gist_id() { GIST_ID=$(cat $index $starred | sed -n "/^$1 / p" | cut -d' ' -f2 | sed -E 's#.*/##') - if [[ -z $GIST_ID ]]; then + 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: echo @@ -242,8 +242,8 @@ _new_file() { # FIXME error handling if gist is not created, file doesn't exist _create_gist() { _set_gist "$@" - [[ -z $files ]] && files=$(_new_file $filename) - [[ -z $description ]] && echo -n 'Type description: ' && read description + [[ -z "$files" ]] && files=$(_new_file $filename) + [[ -z "$description" ]] && echo -n 'Type description: ' && read description for file in $files; do FILE=$(basename $file) -- cgit v1.2.3-70-g09d2