mirror of
https://github.com/jimeh/tmuxifier.git
synced 2026-02-19 09:56:39 +00:00
Improve how return value of certain commands are checked
This commit is contained in:
@@ -18,10 +18,9 @@ if [ -z "$command" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Lookup command, attempt to resolve as alias if fails
|
||||
! command_path="$(command -v "tmuxifier-$command")"
|
||||
|
||||
# Attempt to resolve aliases
|
||||
if [ -z "$command_path" ]; then
|
||||
if [ ! -n $? ]; then
|
||||
resolved="$(tmuxifier-alias "$command")"
|
||||
if [ ! -z "$resolved" ]; then
|
||||
! command_path="$(command -v "tmuxifier-$resolved")"
|
||||
|
||||
@@ -9,10 +9,10 @@ if [ "$1" == "--complete" ]; then
|
||||
fi
|
||||
|
||||
command="$1"
|
||||
! command_path="$(command -v "tmuxifier-$command")"
|
||||
|
||||
# Attempt to resolve aliases
|
||||
if [ -z "$command_path" ]; then
|
||||
# Lookup command, attempt to resolve as alias if fails
|
||||
! command_path="$(command -v "tmuxifier-$command")"
|
||||
if [ ! -n $? ]; then
|
||||
resolved="$(tmuxifier-alias "$command")"
|
||||
if [ ! -z "$resolved" ]; then
|
||||
command="$resolved"
|
||||
|
||||
Reference in New Issue
Block a user