forked from girardinsamuel/cookiecutter-masonite-package
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate_demo_project.py
More file actions
executable file
·35 lines (28 loc) · 942 Bytes
/
generate_demo_project.py
File metadata and controls
executable file
·35 lines (28 loc) · 942 Bytes
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
"""Small script to update demo package when this cookiecutter is updated."""
import os
import shutil
import sys
from cookiecutter.main import cookiecutter
# Clean old generated masonite demo package which are not cleaned by cookiecutter because hidden
shutil.rmtree("../masonite-demo-package/.github/", ignore_errors=True)
# Get template to use
options = sys.argv
tag = None
template = "https://github.com/girardinsamuel/cookiecutter-masonite-package.git"
if len(options) == 2:
tag = options[1]
# Generate the project
print(f"Crafting project from: {template} {tag if tag else ''}")
cookiecutter(
template,
output_dir="../",
no_input=True,
overwrite_if_exists=True,
checkout=tag,
extra_context={
"project_name": "Demo Package",
"project_description": "Demo package to show Masonite package generator.",
},
)
os.chdir("../masonite-demo-package")
# Then commit manually "update with vX.X"