From a9570cde0454bd4a300def24423ea2ae73d4b1b4 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Tue, 19 Sep 2017 11:17:41 +0200 Subject: [PATCH] Make errors more verbose Signed-off-by: Knut Ahlers --- bin/resume | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/resume b/bin/resume index 5cbbab6..22f3224 100755 --- a/bin/resume +++ b/bin/resume @@ -1,6 +1,12 @@ #!/bin/bash -[ -n "${TMUX}" ] && exit 1 +function fail { + echo "Error: $@" + exit 1 +} + +[ -n "${TMUX}" ] && fail "You are already in tmux!" +( which tmux 2>/dev/null ) || fail "No tmux found, can't continue" tmux-agent