Don't check for vim when using $EDITOR
This commit is contained in:
parent
ad5dc95e4d
commit
e30f86800d
@ -46,21 +46,16 @@ commands:
|
|||||||
if ! [ -f $PWD/.enter ] || ! [ -f $PWD/.exit ]; then
|
if ! [ -f $PWD/.enter ] || ! [ -f $PWD/.exit ]; then
|
||||||
echo '.enter or .exit not found'; return 1
|
echo '.enter or .exit not found'; return 1
|
||||||
fi
|
fi
|
||||||
# If vim exists, edit enter and exit scripts.
|
# Exit the autoenv before editing.
|
||||||
if which vim &> /dev/null; then
|
_autoenv_exit $PWD
|
||||||
# Exit the autoenv before editing.
|
if $EDITOR -p $PWD/.enter $PWD/.exit; then
|
||||||
_autoenv_exit $PWD
|
# If enter script exists, authorize it.
|
||||||
if $EDITOR -p $PWD/.enter $PWD/.exit; then
|
[ -f $PWD/.enter ] && _autoenv_authorized $PWD/.enter yes
|
||||||
# If enter script exists, authorize it.
|
# If exit script exists, authorize it.
|
||||||
[ -f $PWD/.enter ] && _autoenv_authorized $PWD/.enter yes
|
[ -f $PWD/.exit ] && _autoenv_authorized $PWD/.exit yes
|
||||||
# If exit script exists, authorize it.
|
|
||||||
[ -f $PWD/.exit ] && _autoenv_authorized $PWD/.exit yes
|
|
||||||
fi
|
|
||||||
# Enter the autoenv.
|
|
||||||
_autoenv_enter $PWD
|
|
||||||
else
|
|
||||||
echo 'vim not found'; return 1
|
|
||||||
fi
|
fi
|
||||||
|
# Enter the autoenv.
|
||||||
|
_autoenv_enter $PWD
|
||||||
;;
|
;;
|
||||||
|
|
||||||
deinit) # Remove .enter and .exit scripts in current directory.
|
deinit) # Remove .enter and .exit scripts in current directory.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user