-
Notifications
You must be signed in to change notification settings - Fork 59
/
rename_package.sh
executable file
·45 lines (32 loc) · 952 Bytes
/
rename_package.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
#!/bin/bash
set -e
# Make sure there is only 1 argument passed
if [ "$#" -ne 1 ]; then
echo "You must provide a new package name"
exit 1
fi
# Make sure the new package name is not empty
if [ -z "$1" ]; then
echo "You must provide a non-empty package name"
exit 1
fi
# get the directory of this script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# get the current package name
PACKAGE=$($DIR/get_package_name.sh)
# Announce the renaming
echo "Renaming from '$PACKAGE' to '$1'"
# .gitignore
sed -i "s|$PACKAGE|$1|g" $DIR/../.gitignore
# Doxyfile
sed -i "s|$PACKAGE|$1|g" $DIR/../Doxyfile
# Makefile
sed -i "s|$PACKAGE|$1|g" $DIR/../Makefile
# setup.cfg
sed -i "s|$PACKAGE|$1|g" $DIR/../setup.cfg
# docs/Makefile
sed -i "s|$PACKAGE|$1|g" $DIR/../docs/Makefile
# docs/make.bat
sed -i "s|$PACKAGE|$1|g" $DIR/../docs/make.bat
# docs/source/conf.py
sed -i "s|$PACKAGE|$1|g" $DIR/../docs/source/conf.py