aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/gist8
1 files changed, 4 insertions, 4 deletions
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
95# Show the list of gist, but not updated time 95# Show the list of gist, but not updated time
96# TODO show git status outdated 96# TODO show git status outdated
97_show_list() { 97_show_list() {
98 if [[ ! -e $1 ]]; then 98 if [[ ! -e "$1" ]]; then
99 echo No local file found for last update 99 echo No local file found for last update
100 echo Please run command: 100 echo Please run command:
101 echo " gist update" 101 echo " gist update"
@@ -167,7 +167,7 @@ _sync_repos() {
167 167
168_gist_id() { 168_gist_id() {
169 GIST_ID=$(cat $index $starred | sed -n "/^$1 / p" | cut -d' ' -f2 | sed -E 's#.*/##') 169 GIST_ID=$(cat $index $starred | sed -n "/^$1 / p" | cut -d' ' -f2 | sed -E 's#.*/##')
170 if [[ -z $GIST_ID ]]; then 170 if [[ -z "$GIST_ID" ]]; then
171 echo -e "Not a valid index: \e[31m$1\e[0m" 171 echo -e "Not a valid index: \e[31m$1\e[0m"
172 echo Use the index number in the first column instead: 172 echo Use the index number in the first column instead:
173 echo 173 echo
@@ -242,8 +242,8 @@ _new_file() {
242# FIXME error handling if gist is not created, file doesn't exist 242# FIXME error handling if gist is not created, file doesn't exist
243_create_gist() { 243_create_gist() {
244 _set_gist "$@" 244 _set_gist "$@"
245 [[ -z $files ]] && files=$(_new_file $filename) 245 [[ -z "$files" ]] && files=$(_new_file $filename)
246 [[ -z $description ]] && echo -n 'Type description: ' && read description 246 [[ -z "$description" ]] && echo -n 'Type description: ' && read description
247 247
248 for file in $files; do 248 for file in $files; do
249 FILE=$(basename $file) 249 FILE=$(basename $file)