-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.sh
executable file
·47 lines (38 loc) · 1.04 KB
/
configure.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env bash
#
# Copies the various configuration files into their respective locations
set -eu
force=0
if [[ ${1:-} == "--force" ]]; then
force=1
fi
copyfile() {
source=$1
destination=$2
if [[ $force == 1 ]]; then
rm -f $destination
fi
if [[ -f $destination ]]; then
echo " Cowardly refusing to overwrite $destination."
echo " Use --force if you really want this."
else
cp $source $destination
fi
}
dest=${1:-}
if [[ $force == 1 ]]; then
dest=${2:-}
fi
dest=$(realpath $dest)
if [[ $dest == "" ]]; then
echo "You must specify a destination path"
exit 1
fi
echo
echo "* Copying configuration to $dest"
copyfile settings/onisite/urls.py $dest/onisite/urls.py
copyfile settings/onisite/settings_local.py $dest/onisite/settings_local.py
copyfile settings/docker-compose.override.yml $dest/docker-compose.override.yml-development
copyfile settings/calendar/config.py $dest/onisite/plugins/calendar/config.py
copyfile settings/sitemap-custom.xml $dest/static/sitemap-custom.xml
copyfile settings/.env $dest/.env