-
Notifications
You must be signed in to change notification settings - Fork 2
/
bootstrap
executable file
·43 lines (34 loc) · 1.51 KB
/
bootstrap
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
clean() {
cp -r .clean/* .
rm -rf .github elvis.config
}
"$@"
bootstraping() {
REPO_NAME=$(basename `git rev-parse --show-toplevel`)
README=README
GIT_URL=$(git config --get remote.origin.url)
mv "src/{{ repo-name }}_prv.erl" "src/${REPO_NAME}_prv.erl"
mv "src/{{ repo-name }}.app.src" "src/${REPO_NAME}.app.src"
mv "src/{{ repo-name }}.erl" "src/${REPO_NAME}.erl"
mv "test/{{ repo-name }}_SUITE.erl" "test/${REPO_NAME}_SUITE.erl"
mv "{{ readme }}.md" "${README}.md"
sed -i "s/{{ repo-name }}/${REPO_NAME}/g" rebar.config
sed -i "s/{{ repo-name }}/${REPO_NAME}/g" src/${REPO_NAME}_prv.erl
sed -i "s/{{ repo-name }}/${REPO_NAME}/g" src/${REPO_NAME}.app.src
sed -i "s/{{ repo-name }}/${REPO_NAME}/g" src/${REPO_NAME}.erl
sed -i "s/{{ repo-name }}/${REPO_NAME}/g" test/${REPO_NAME}_SUITE.erl
sed -i "s,{{ git-url }},${GIT_URL},g" src/${REPO_NAME}.app.src
sed -i "s/{{ repo-name }}/${REPO_NAME}/g" ${README}.md
sed -i '/always/d' .github/workflows/ci.yaml
sed -i '/ootstrap/d' .github/workflows/ci.yaml
if [ "$1" == "clean" ]; then
return 0
else
sed -i "s/{{ repo-name }}/${REPO_NAME}/g" .github/ISSUE_TEMPLATE/bug_report.md
sed -i "s/{{ repo-name }}/${REPO_NAME}/g" .github/ISSUE_TEMPLATE/feature_request.md
sed -i "s,{{ git-url }},${GIT_URL},g" .github/ISSUE_TEMPLATE/bug_report.md
sed -i "s,{{ git-url }},${GIT_URL},g" .github/ISSUE_TEMPLATE/feature_request.md
fi
}
bootstraping "$@"
rm -rf bootstrap .clean