File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,9 @@ copy_and_replace() {
81
81
local input=" $1 "
82
82
local output=" $2 "
83
83
84
+ if [[ ! -f " $input " ]] ; then
85
+ return 0
86
+ fi
84
87
awk \
85
88
-v author_fullname=" $author_fullname " \
86
89
-v author_username=" $author_username " \
@@ -449,17 +452,15 @@ confirm() {
449
452
}
450
453
451
454
ask () {
452
- # $1 = variable name
453
- # $2 = question
454
- # $3 = default value
455
- # not using read -i because that doesn't work on MacOS
455
+ # $1 = question
456
+ # $2 = default value
456
457
local ANSWER
457
458
if [[ -n " ${2:- } " ]] ; then
458
459
read -r -p " $1 ($2 ) > " ANSWER
459
460
else
460
461
read -r -p " $1 > " ANSWER
461
462
fi
462
- echo " $ANSWER "
463
+ [[ -n " $ANSWER " ]] && echo " $ANSWER " || echo " ${2 :- } "
463
464
}
464
465
465
466
trap " die \" ERROR \$ ? after \$ SECONDS seconds \n\
You can’t perform that action at this time.
0 commit comments