From 9344a76d9ce3e96b65a7d1c64ee8af7adc32b35c Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 28 Jul 2013 11:47:08 -0400 Subject: get_conf(): Resolve incoming dir if it exists. --- diff --git a/src/pro-archman.sh b/src/pro-archman.sh index 38e7941..8d07481 100644 --- a/src/pro-archman.sh +++ b/src/pro-archman.sh @@ -131,6 +131,8 @@ get_options() get_conf() { + local old_dir= + # Set defaults. conf_incoming_channel='dev' conf_incoming_dir='../incoming' @@ -140,8 +142,12 @@ get_conf() . "${opt_base_dir}/conf" fi - conf_incoming_dir="$(cd "${opt_base_dir}" && \ - cd "${conf_incoming_dir}" && pwd)" + old_dir="$(pwd)" + cd "${opt_base_dir}" + if [ -d "${conf_incoming_dir}" ]; then + conf_incoming_dir="$(cd "${conf_incoming_dir}" && pwd)" + fi + cd "${old_dir}" return 0 } -- cgit v0.9.1