Skip to content

Commit 74c1efa

Browse files
authored
feat(hook): run task init after project generation (#10)
1 parent e39a9a7 commit 74c1efa

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

hooks/post_gen_project.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def run_post_gen_hook():
145145
write_context(context=context)
146146

147147
# Generate a fully up-to-date lock file
148-
subprocess.run(["uv", "lock", "--upgrade"], check=True, capture_output=True, text=True)
148+
subprocess.run(["uv", "lock", "--upgrade"], check=True, capture_output=True)
149149
subprocess.run(["git", "add", "-A"], capture_output=True, check=True)
150150

151151
# This constructs a git remote using the prompt answers
@@ -181,6 +181,10 @@ def run_post_gen_hook():
181181
capture_output=True,
182182
check=True,
183183
)
184+
185+
# Run the initial setup step automatically so pre-commit hooks, etc. are pre-installed. However, if it fails, don't fail the overall repo generation
186+
# (i.e. check=False)
187+
subprocess.run(["task", "init"], check=False, capture_output=True)
184188
except subprocess.CalledProcessError as error:
185189
stdout = error.stdout.decode("utf-8") if error.stdout else "No stdout"
186190
stderr = error.stderr.decode("utf-8") if error.stderr else "No stderr"

0 commit comments

Comments
 (0)