From 655bdb9a756e39085a8c43a7eb072658ba742ac9 Mon Sep 17 00:00:00 2001 From: Bruno Sutic Date: Thu, 28 Aug 2014 12:45:01 +0200 Subject: [PATCH] Refactor checking if tmux session file exists --- CHANGELOG.md | 1 + scripts/session_restorer.sh | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4097d19..a8edcb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ### master +- refactor checking if saved tmux session exists ### v0.0.5, 2014-08-28 - restore pane processes diff --git a/scripts/session_restorer.sh b/scripts/session_restorer.sh index 8e6ba90..f9ccadc 100755 --- a/scripts/session_restorer.sh +++ b/scripts/session_restorer.sh @@ -15,8 +15,8 @@ is_line_type() { check_saved_session_exists() { local saved_session="$(last_session_path)" if [ ! -f $saved_session ]; then - display_message "Saved session not found!" - exit + display_message "Saved tmux session not found!" + return 1 fi } @@ -149,8 +149,7 @@ restore_active_and_alternate_sessions() { } main() { - if supported_tmux_version_ok; then - check_saved_session_exists + if supported_tmux_version_ok && check_saved_session_exists; then restore_all_sessions restore_all_pane_processes restore_pane_layout_for_each_window >/dev/null 2>&1