From f6c5717a7abf672e37f9367c6473d38b83fcd36f Mon Sep 17 00:00:00 2001 From: John D Pell Date: Sun, 19 Sep 2021 21:52:46 -0700 Subject: [PATCH] plugins/textmate: use `_command_exists` Addresses bash-it/bash-it#1632 --- clean_files.txt | 1 + plugins/available/textmate.plugin.bash | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/clean_files.txt b/clean_files.txt index b8fcee4f..8fdc0c10 100644 --- a/clean_files.txt +++ b/clean_files.txt @@ -86,6 +86,7 @@ plugins/available/goenv.plugin.bash plugins/available/history-search.plugin.bash plugins/available/history-substring-search.plugin.bash plugins/available/history.plugin.bash +plugins/available/textmate.plugin.bash plugins/available/xterm.plugin.bash # tests diff --git a/plugins/available/textmate.plugin.bash b/plugins/available/textmate.plugin.bash index e3538c1e..5c81f195 100644 --- a/plugins/available/textmate.plugin.bash +++ b/plugins/available/textmate.plugin.bash @@ -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