From b65355a35ac72b611f74c6d0b151751b756e519b Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Thu, 26 Apr 2012 08:50:59 +0100 Subject: [PATCH] Boolean logic is hard (and buggy? wtf?) Fixed a bug with alias resolution not working, for reasons that are currently beyond my understanding of shell scripting it would seem. --- bin/tmuxifier | 2 +- libexec/tmuxifier-completions | 2 +- libexec/tmuxifier-help | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/tmuxifier b/bin/tmuxifier index 281182a..0c7d2ca 100755 --- a/bin/tmuxifier +++ b/bin/tmuxifier @@ -26,7 +26,7 @@ case "$command" in * ) # Lookup command, attempt to resolve as alias if fails ! command_path="$(command -v "tmuxifier-$command")" - if [ ! -n $? ]; then + if [ -z "$command_path" ]; then resolved="$(tmuxifier-alias "$command")" if [ ! -z "$resolved" ]; then ! command_path="$(command -v "tmuxifier-$resolved")" diff --git a/libexec/tmuxifier-completions b/libexec/tmuxifier-completions index e42b981..d9334c3 100755 --- a/libexec/tmuxifier-completions +++ b/libexec/tmuxifier-completions @@ -20,7 +20,7 @@ fi # Lookup command, attempt to resolve as alias if fails ! command_path="$(command -v "tmuxifier-$command")" -if [ ! -n $? ]; then +if [ -z "$command_path" ]; then resolved="$(tmuxifier-alias "$command")" if [ ! -z "$resolved" ]; then ! command_path="$(command -v "tmuxifier-$resolved")" diff --git a/libexec/tmuxifier-help b/libexec/tmuxifier-help index 34e6042..db7b6a8 100755 --- a/libexec/tmuxifier-help +++ b/libexec/tmuxifier-help @@ -12,7 +12,7 @@ command="$1" # Lookup command, attempt to resolve as alias if fails ! command_path="$(command -v "tmuxifier-$command")" -if [ ! -n $? ]; then +if [ -z "$command_path" ]; then resolved="$(tmuxifier-alias "$command")" if [ ! -z "$resolved" ]; then command="$resolved"