File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929 exit 1
3030fi
3131
32- # 3. Replace import in src/**/*.py
32+ # 3. Replace import in src/**/*.py and entry points
3333# from app.main import main -> from <appname_with_underscores>.main import main
34+ # Also replace "app.main:main" -> "<appname_with_underscores>.main:main" in pyproject.toml
3435
3536find src -type f -name " *.py" -print0 | while IFS= read -r -d ' ' file; do
3637 LC_ALL=C sed -i.bak \
@@ -39,6 +40,12 @@ find src -type f -name "*.py" -print0 | while IFS= read -r -d '' file; do
3940 rm -f " ${file} .bak"
4041done
4142
43+ # Replace app.main:main entry point in pyproject.toml
44+ if [[ -f " pyproject.toml" ]]; then
45+ LC_ALL=C sed -i.bak " s/app\.main:main/${APPNAME_UNDERSCORE} .main:main/g" " pyproject.toml"
46+ rm -f " pyproject.toml.bak"
47+ fiand entry points
48+
4249
4350echo " Done:"
4451echo " Replaced 'template-python' → '${APPNAME} '"
You can’t perform that action at this time.
0 commit comments