From 339927f8fbfeaf6d66113b1882e92456eaa8b656 Mon Sep 17 00:00:00 2001 From: Niklas Spielbauer <50439565+nspielbau@users.noreply.github.com> Date: Mon, 29 Jan 2024 20:42:31 +0100 Subject: [PATCH] Added check for config file (#36) Script will exit if file is not present Signed-off-by: Niklas Spielbauer Co-authored-by: Niklas Spielbauer --- catmux/catmux_create_session.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/catmux/catmux_create_session.py b/catmux/catmux_create_session.py index 4e0960e..25f4d22 100644 --- a/catmux/catmux_create_session.py +++ b/catmux/catmux_create_session.py @@ -111,6 +111,9 @@ def main(): command = ["tmux", "-L", args.server_name] if args.tmux_config: tmux_config = args.tmux_config + if not os.path.exists(tmux_config): + print("Given tmux_config file does not exist") + sys.exit(1) elif os.path.exists(os.path.expanduser("~/.tmux.conf")): tmux_config = os.path.expanduser("~/.tmux.conf") elif os.path.exists("/etc/tmux.conf"):