Avoid exiting with a cleaner syntax for commands that might fail

This commit is contained in:
2012-04-26 02:22:40 +01:00
parent 0d3cfb2494
commit 855c522cf0
4 changed files with 7 additions and 7 deletions

View File

@@ -18,13 +18,13 @@ if [ -z "$command" ]; then
exit 1
fi
command_path="$(command -v "tmuxifier-$command" || true)"
! command_path="$(command -v "tmuxifier-$command")"
# Attempt to resolve aliases
if [ -z "$command_path" ]; then
resolved="$(tmuxifier-alias "$command")"
if [ ! -z "$resolved" ]; then
command_path="$(command -v "tmuxifier-$resolved" || true)"
! command_path="$(command -v "tmuxifier-$resolved")"
fi
fi