fix: handle case for no argument

This commit is contained in:
James Dixon 2020-05-27 20:04:38 -04:00
parent 81ad169c07
commit d5856d76d6

View File

@ -15,8 +15,15 @@ full_post_url=""
# TODO set deployment variables # TODO set deployment variables
set_vars() { set_vars() {
# handle extraneous .md file extension
local arg="$1" local arg="$1"
# handle no argument case
if [[ -z "$arg" ]]; then
echo -en "Please enter a post title: "
read -r arg
fi
# handle extraneous .md file extension
if [[ ! "$arg" =~ .md$ ]]; then if [[ ! "$arg" =~ .md$ ]]; then
postname="$arg" postname="$arg"
else else