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:
@@ -24,10 +24,9 @@ case "$command" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
* )
|
* )
|
||||||
|
# Lookup command, attempt to resolve as alias if fails
|
||||||
! command_path="$(command -v "tmuxifier-$command")"
|
! command_path="$(command -v "tmuxifier-$command")"
|
||||||
|
if [ ! -n $? ]; then
|
||||||
# Attempt to resolve aliases
|
|
||||||
if [ -z "$command_path" ]; then
|
|
||||||
resolved="$(tmuxifier-alias "$command")"
|
resolved="$(tmuxifier-alias "$command")"
|
||||||
if [ ! -z "$resolved" ]; then
|
if [ ! -z "$resolved" ]; then
|
||||||
! command_path="$(command -v "tmuxifier-$resolved")"
|
! command_path="$(command -v "tmuxifier-$resolved")"
|
||||||
|
|||||||
@@ -18,10 +18,9 @@ if [ -z "$command" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Lookup command, attempt to resolve as alias if fails
|
||||||
! command_path="$(command -v "tmuxifier-$command")"
|
! command_path="$(command -v "tmuxifier-$command")"
|
||||||
|
if [ ! -n $? ]; then
|
||||||
# Attempt to resolve aliases
|
|
||||||
if [ -z "$command_path" ]; then
|
|
||||||
resolved="$(tmuxifier-alias "$command")"
|
resolved="$(tmuxifier-alias "$command")"
|
||||||
if [ ! -z "$resolved" ]; then
|
if [ ! -z "$resolved" ]; then
|
||||||
! command_path="$(command -v "tmuxifier-$resolved")"
|
! command_path="$(command -v "tmuxifier-$resolved")"
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ if [ "$1" == "--complete" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
command="$1"
|
command="$1"
|
||||||
! command_path="$(command -v "tmuxifier-$command")"
|
|
||||||
|
|
||||||
# Attempt to resolve aliases
|
# Lookup command, attempt to resolve as alias if fails
|
||||||
if [ -z "$command_path" ]; then
|
! command_path="$(command -v "tmuxifier-$command")"
|
||||||
|
if [ ! -n $? ]; then
|
||||||
resolved="$(tmuxifier-alias "$command")"
|
resolved="$(tmuxifier-alias "$command")"
|
||||||
if [ ! -z "$resolved" ]; then
|
if [ ! -z "$resolved" ]; then
|
||||||
command="$resolved"
|
command="$resolved"
|
||||||
|
|||||||
Reference in New Issue
Block a user