From 6d9be433eb4f3f79279b5801e80ea7364d13d961 Mon Sep 17 00:00:00 2001 From: Teo-CD Date: Mon, 1 Jun 2020 00:31:13 +0200 Subject: [PATCH] Check EDITOR, fixed typo --- new_article.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/new_article.sh b/new_article.sh index dff4c77..b0c885d 100755 --- a/new_article.sh +++ b/new_article.sh @@ -39,6 +39,7 @@ EDITOR=${EDITOR:-$(update-alternatives --list editor | head -n1)} # If not present set it to vi EDITOR=${EDITOR:-vi} -# Open the newly created file, openfully in the chosen editor - -$EDITOR content/articles/"$filename" +# Open the newly created file, hopefully in the chosen editor +if [ -n "$EDITOR" ]; then + $EDITOR content/articles/"$filename" +fi