Skip to content

Commit

Permalink
Added check for config file
Browse files Browse the repository at this point in the history
Script will exit if file is not present

Signed-off-by: Niklas Spielbauer <[email protected]>
  • Loading branch information
nspielbau authored and fmauch committed Jan 29, 2024
1 parent 82c866e commit d06afdf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions catmux/catmux_create_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check warning on line 116 in catmux/catmux_create_session.py

View check run for this annotation

Codecov / codecov/patch

catmux/catmux_create_session.py#L114-L116

Added lines #L114 - L116 were not covered by tests
elif os.path.exists(os.path.expanduser("~/.tmux.conf")):
tmux_config = os.path.expanduser("~/.tmux.conf")
elif os.path.exists("/etc/tmux.conf"):
Expand Down

0 comments on commit d06afdf

Please sign in to comment.