File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4444 exit 1
4545 fi
4646
47- # Check that testproject was replaced in pyproject.toml
48- if grep -q "testproject" pyproject.toml; then
49- echo "Error: 'testproject' still found in pyproject.toml"
50- exit 1
51- fi
52-
53- if ! grep -q "my-test-app" pyproject.toml; then
54- echo "Error: 'my-test-app' not found in pyproject.toml"
55- exit 1
56- fi
57-
58- echo "✓ All checks passed!"
59-
60- - name : Install project with new name
61- run : |
62- pip install --upgrade pip
63- pip install -e .
47+ # Check that template-python was replaced in pyproject.toml
48+ if grep -q "template-python" pyproject.toml; then
49+ echo "Error: 'template-python' still found in pyproject.toml"
6450
6551 - name : Test renamed command works
6652 run : |
Original file line number Diff line number Diff line change 99APPNAME=" $1 "
1010APPNAME_UNDERSCORE=" ${APPNAME// -/ _} "
1111
12- # 1. Find and replace "testproject" with app name
13- grep -rl " testproject" . | while IFS= read -r file; do
14- LC_ALL=C sed -i.bak " s/testproject/${APPNAME} /g" " $file "
12+ # 1. Find and replace "template-python" with app name
13+ grep -rl " template-python" . --exclude-dir=.git --exclude-dir=docs/build | while IFS= read -r file; do
14+ LC_ALL=C sed -i.bak " s/template-python/${APPNAME} /g" " $file "
15+ rm -f " ${file} .bak"
16+ done
17+
18+ # Also replace template_python with appname_underscore
19+ grep -rl " template_python" . --exclude-dir=.git --exclude-dir=docs/build | while IFS= read -r file; do
20+ LC_ALL=C sed -i.bak " s/template_python/${APPNAME_UNDERSCORE} /g" " $file "
1521 rm -f " ${file} .bak"
1622done
1723
3541
3642
3743echo " Done:"
38- echo " Replaced 'testproject' → '${APPNAME} '"
44+ echo " Replaced 'template-python' → '${APPNAME} '"
45+ echo " Replaced 'template_python' → '${APPNAME_UNDERSCORE} '"
3946echo " Moved src/app → src/${APPNAME_UNDERSCORE} "
4047echo " Replaced import statements in src/**/*.py"
4148echo " You can now remove this script with: rm setup_project.sh"
You can’t perform that action at this time.
0 commit comments