plugins/textmate: use _command_exists

Addresses bash-it/bash-it#1632
This commit is contained in:
John D Pell
2021-09-19 21:52:46 -07:00
parent a375e7131e
commit f6c5717a7a
2 changed files with 6 additions and 3 deletions

View File

@@ -1,7 +1,9 @@
# shellcheck shell=bash
cite about-plugin
about-plugin 'set textmate as a default editor'
if $(command -v mate &> /dev/null) ; then
export EDITOR="$(which mate) -w"
export GIT_EDITOR=$EDITOR
if _command_exists mate; then
EDITOR="$(type -p mate) -w"
GIT_EDITOR="$EDITOR"
export EDITOR GIT_EDITOR
fi