aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/tmux/session-load.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/tmux/session-load.sh b/modules/tmux/session-load.sh
index 509dabe..623ff57 100644
--- a/modules/tmux/session-load.sh
+++ b/modules/tmux/session-load.sh
@@ -3,7 +3,8 @@
# usage: to create a project/session, create a symlink in .projects to the working directory
# the name of the symlink is the name of the project
-# if there is no path specific, prompt via fzf
+# if there is no path specified, prompt via fzf
+#
if [[ $# -eq 1 ]]; then
input=$1
else
@@ -17,6 +18,11 @@ fi
project_name=$input
project_path=$(readlink "$HOME/.projects/$project_name")
+if [[ -d $project_path ]]
+ echo "Error: directory '$project_path' does not exist." >&2
+ exit 1
+fi
+
if [[ -z $(pgrep tmux) ]]; then
tmux start-sever # blocking
fi