From 665cd8ffdbc69bb1068c8f4871f906b641d79c76 Mon Sep 17 00:00:00 2001 From: Philipp Millar Date: Tue, 17 Mar 2015 11:50:55 +0100 Subject: [PATCH] Load default configurations. This closes #5 Tmux-up tries to load a default configuration from ~/.tmux now, if the specified file doesn't exist in the current directory. --- tmux-up | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tmux-up b/tmux-up index cacb769..4a81d2e 100755 --- a/tmux-up +++ b/tmux-up @@ -38,8 +38,12 @@ then exit 0 fi +CONF_DIR=${TMUXUP_CONF_DIR:-$HOME/.tmux} CONF=${1:-.tmux.conf} +# try default configuration directory +[ ! -f "$CONF" ] && CONF="$CONF_DIR/$CONF" + if [ ! -f "$CONF" ] then echo "$0: cannot stat ‘${CONF}’: No such file"