Fix bug where three editors are opened
This commit is contained in:
parent
631729fe09
commit
dd41951442
6
nx
6
nx
|
@ -14,10 +14,10 @@ test -f "$1" && error "$1 already exists"
|
||||||
fullpath="$HOME/code/scripts/$1"
|
fullpath="$HOME/code/scripts/$1"
|
||||||
touch "$fullpath" && chmod +x "$fullpath"
|
touch "$fullpath" && chmod +x "$fullpath"
|
||||||
|
|
||||||
test -n "$EDITOR" && $EDITOR "$fullpath"
|
test -n "$EDITOR" && $EDITOR "$fullpath" && exit 0
|
||||||
test -n "$VISUAL" && $VISUAL "$fullpath"
|
test -n "$VISUAL" && $VISUAL "$fullpath" && exit 0
|
||||||
if command -v vi 1>/dev/null; then
|
if command -v vi 1>/dev/null; then
|
||||||
vi "$fullpath"
|
vi "$fullpath" && exit 0
|
||||||
else
|
else
|
||||||
error "No editor program found (set \$EDITOR or \$VISUAL, or install \`vi\`)"
|
error "No editor program found (set \$EDITOR or \$VISUAL, or install \`vi\`)"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue