From a2727dbe891221da526a0b0b587f19d7041aaa50 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Tue, 19 Sep 2017 12:55:43 +0200 Subject: [PATCH] Use script_framework for resume script Signed-off-by: Knut Ahlers --- bin/resume | 5 +---- bin/script_framework.sh | 9 +++++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/bin/resume b/bin/resume index 22f3224..7320948 100755 --- a/bin/resume +++ b/bin/resume @@ -1,9 +1,6 @@ #!/bin/bash -function fail { - echo "Error: $@" - exit 1 -} +source "${HOME}/bin/script_framework.sh" [ -n "${TMUX}" ] && fail "You are already in tmux!" ( which tmux 2>/dev/null ) || fail "No tmux found, can't continue" diff --git a/bin/script_framework.sh b/bin/script_framework.sh index 2ea22d7..9a38ce0 100644 --- a/bin/script_framework.sh +++ b/bin/script_framework.sh @@ -7,8 +7,9 @@ function error { echo -e "${COLOR_RED}$@${COLOR_PLAIN}" } -function success { - echo -e "${COLOR_GREEN}$@${COLOR_PLAIN}" +function fail { + error "Error: $@" + exit 1 } function info { @@ -18,3 +19,7 @@ function info { function step { info "[$(date +%H:%M:%S)] $@" } + +function success { + echo -e "${COLOR_GREEN}$@${COLOR_PLAIN}" +}