-
Notifications
You must be signed in to change notification settings - Fork 2
/
customize.sh
executable file
·54 lines (45 loc) · 1.2 KB
/
customize.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
48
49
50
51
52
53
54
#!/usr/bin/env bash
# vim:ts=4:sts=4:sw=4:et
#
# Author: Hari Sekhon
# Date: 2023-06-02 01:29:52 +0100 (Fri, 02 Jun 2023)
#
# https://github.com/HariSekhon/Template-repo
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
#
# https://www.linkedin.com/in/HariSekhon
#
# Replaces references in this repo with the new name of your choice
#
# The delete this script in the new templated repo and carry on
set -euo pipefail
[ -n "${DEBUG:-}" ] && set -x
srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$srcdir"
if [ $# -ne 1 ]; then
echo "usage: <new_repo_name>"
exit 3
fi
repo="$1"
if uname -s | grep -q Darwin; then
sed(){
gsed "$@"
}
fi
sed -i "s/- Template Repo$/- $repo/" README.md
sed -i "s/Template-Repo/$repo/gi" \
README.md \
Makefile \
azure-pipelines.yml \
bitbucket-pipelines.yml \
sonar-project.properties \
.github/workflows/*.y*ml
# can't commit without the submodules checked out
#
# error: 'bash-tools' does not have a commit checked out
# fatal: updating files failed
#
make init