From dd41951442ec05ae0db355f8f9640535cca3ca95 Mon Sep 17 00:00:00 2001 From: The Magician Date: Wed, 22 Nov 2023 12:38:37 +0000 Subject: [PATCH] Fix bug where three editors are opened --- nx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nx b/nx index 003a76a..f6b6d03 100755 --- a/nx +++ b/nx @@ -14,10 +14,10 @@ test -f "$1" && error "$1 already exists" fullpath="$HOME/code/scripts/$1" touch "$fullpath" && chmod +x "$fullpath" -test -n "$EDITOR" && $EDITOR "$fullpath" -test -n "$VISUAL" && $VISUAL "$fullpath" +test -n "$EDITOR" && $EDITOR "$fullpath" && exit 0 +test -n "$VISUAL" && $VISUAL "$fullpath" && exit 0 if command -v vi 1>/dev/null; then - vi "$fullpath" + vi "$fullpath" && exit 0 else error "No editor program found (set \$EDITOR or \$VISUAL, or install \`vi\`)" fi