Skip to content

Commit

Permalink
Allow admin to override default config location also for rebar and su…
Browse files Browse the repository at this point in the history
…ch (#1627)

(cherry picked from commit f0b2915)
  • Loading branch information
CyBeRoni authored and ddeboer committed Mar 2, 2017
1 parent 26e3b0f commit 9ceb9a4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/scripts/helpers/zotonic_setup
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,13 @@ function find_enabled_sites {
export -f find_enabled_sites

function find_config {
# Allow admin to override default behaviour
[ ! -z "$ZOTONIC_CONFIG_DIR" ] && { echo "${ZOTONIC_CONFIG_DIR}/$1"; return 0; }

filename="$1"
vsn_minor=$(minor_version)
vsn_major=$(major_version)

for file in "$HOME/.zotonic/$NODENAME/$filename" "$HOME/.zotonic/$vsn_minor/$filename" "$HOME/.zotonic/$vsn_major/$filename" "$HOME/.zotonic/$filename" \
"/etc/zotonic/$NODENAME/$filename" "/etc/zotonic/$vsn_minor/$filename" "/etc/zotonic/$vsn_major/$filename" "/etc/zotonic/$filename"
do
Expand All @@ -82,8 +86,6 @@ function consult_config {
export -f consult_config

function find_config_arg {
[ ! -z "$ZOTONIC_CONFIG_DIR" ] && { echo "-config ${ZOTONIC_CONFIG_DIR}/$1"; return 0; }

file=$(find_config $1)
if [ "$file" == "" ]; then
break
Expand Down

0 comments on commit 9ceb9a4

Please sign in to comment.