defreplace_template(directory:Path,template:str,replace_with:str):"""Replace all occurrences of `template` with the given text."""forfileindirectory.rglob("*"):iffile.is_file():replace_template_file(file,template,replace_with)
definit_parser(parser):""" Initialize an argparse object to parse the project directory and the app name. """parser.add_argument("project_dir",help="The project directory.",type=str)parser.add_argument("app_name",help="The name of the application.",type=str)