-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstantiate.bash
executable file
·65 lines (55 loc) · 2.38 KB
/
instantiate.bash
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#! /bin/bash
################################################################################
# Copyright (c) 2017 Bryce Adelstein Lelbach aka wash <[email protected]>
#
# Distributed under the Creative Commons Attribution 3.0 Unported License.
# (See https://creativecommons.org/licenses/by/3.0).
################################################################################
# Supported events.
EVENTS="cppnow or cppcon"
################################################################################
if [ "${#}" -lt 1 ]; then
echo "Usage: `basename ${0}` <event>"
echo " where <event> is ${EVENTS}"
exit 1
fi
EVENT=${1}
case ${EVENT} in
cppnow)
CONFERENCE='C++Now'
COMMUNITY='C++ and Boost'
COC_TEAM_FIRST_NAMES='Jon, Bryce and Jackie'
COC_TEAM_FULL_NAMES='Jon Kalb (Conference Chair), Bryce Adelstein Lelbach (Program Chair) and Jackie Kay'
COC_DECISION_MAKERS='Jon'
COC_EMAIL='[[email protected]](mailto:[email protected])'
;;
cppcon)
CONFERENCE='CppCon'
COMMUNITY='C++'
COC_TEAM_FIRST_NAMES='Jon, Herb, Bryce, Jackie and Titus'
COC_TEAM_FULL_NAMES='Jon Kalb (Conference Chair), Herb Sutter (Standard C++ Foundation Advisor), Bryce Adelstein Lelbach (Program Chair), Jackie Kay and Titus Winters'
COC_DECISION_MAKERS='Jon and Herb'
COC_EMAIL='[[email protected]](mailto:[email protected])'
;;
*)
echo "ERROR: Unknown event '${EVENT}'"
echo " Supported events are ${EVENTS}"
exit 2
;;
esac
################################################################################
# Files to perform substition on.
TEMPLATE_FILES="README.md code_of_conduct.md attendee_procedure_for_incident_handling.md staff_procedure_for_incident_handling.md"
[ -f README.md ] && cp README.md README.md.backup
[ -f README_generic.md ] && cp README_generic.md README_generic.md.backup
git checkout -- README.md
[ -f README_generic.md ] && git checkout -- README_generic.md
[ -f README_generic.md ] && mv README_generic.md README.md
sed -i.backup "
s/%%CONFERENCE%%/${CONFERENCE}/g;
s/%%COMMUNITY%%/${COMMUNITY}/g;
s/%%COC_TEAM_FIRST_NAMES%%/${COC_TEAM_FIRST_NAMES}/g;
s/%%COC_TEAM_FULL_NAMES%%/${COC_TEAM_FULL_NAMES}/g;
s/%%COC_DECISION_MAKERS%%/${COC_DECISION_MAKERS}/g;
s/%%COC_EMAIL%%/${COC_EMAIL}/g;
" ${TEMPLATE_FILES}