diff options
author | P. J. McDermott <pjm@nac.net> | 2013-07-28 11:47:08 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2013-07-28 11:47:08 (EDT) |
commit | 9344a76d9ce3e96b65a7d1c64ee8af7adc32b35c (patch) | |
tree | 944b37ef66dab5a067899a4c9201dbbcdb89e6d7 /src | |
parent | ff9bb06e3044311aa16f3a34fdb09b4e53a3c6f5 (diff) |
get_conf(): Resolve incoming dir if it exists.
Diffstat (limited to 'src')
-rw-r--r-- | src/pro-archman.sh | 10 |
1 files changed, 8 insertions, 2 deletions
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 } |