diff options
author | Marius Halden <marius.h@lden.org> | 2017-11-03 16:13:59 +0100 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2017-11-03 16:13:59 +0100 |
commit | 42d874db498d0fabae92d0c87acf99054d92391b (patch) | |
tree | d0cf5afdee3d244c4e5da6fe1ab9acba620634df /bin/switch-site | |
parent | 19a7c5dda85a47a68040c742791e9cd9d3e52be6 (diff) | |
parent | dc7613329c275cd158fdde8faf1c0e301f5b7202 (diff) |
Merge tag 'v2.2' into fiksgatami-dev
Diffstat (limited to 'bin/switch-site')
-rwxr-xr-x | bin/switch-site | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/bin/switch-site b/bin/switch-site new file mode 100755 index 000000000..c4ca53ca9 --- /dev/null +++ b/bin/switch-site @@ -0,0 +1,35 @@ +#!/bin/sh + +# Symlinks a file like conf/general-foobar.yml to conf/general.yml, +# to make switching between cobrands simpler while debugging. + +# Takes a single argument which should be a site name from one of +# your config files, like "oxfordshire" from conf/general-oxforshire.yml + +# Run from the fixmystreet directory, like so: +# $ bin/switch-site oxfordshire + +if [ -z "$1" ] +then + current_target=$(readlink conf/general.yml) + if [ -z $current_target ] + then + echo 'Supply a config name, from the following list:' + else + echo 'Currently using settings from:' + echo " $current_target" + echo 'To change, supply a config name from the following list:' + fi + ls conf/general-*.yml | sed 's/.*general-\(.*\)\.yml/ \1/' + exit 1 +fi + +if [ -e "conf/general-$1.yml" ] +then + # -f flag replaces the target file if it already exists. + # Remember that 1st argument is a file path relative to + # the file specified in the second argument. + ln -sf general-$1.yml conf/general.yml +else + echo "File conf/general-$1.yml does not exist." +fi |