Skip to content

Commit 12abba5

Browse files
authored
fix(create): prevent vp create library template from hanging in silent mode (#757)
When running `vp create` interactively without `--verbose`, create-tsdown hangs because stdin is piped in silent/compact mode. Add `--template default` flag when running silently to prevent the hang. ![image.png](https://app.graphite.com/user-attachments/assets/d6164993-9ee8-432b-bc3e-eaa459ae798a.png)
1 parent 50acce9 commit 12abba5

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

packages/cli/src/create/templates/builtin.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ export async function executeBuiltinTemplate(
2727
}
2828
} else if (templateInfo.command === BuiltinTemplate.library) {
2929
templateInfo.command = 'create-tsdown@latest';
30-
if (!templateInfo.interactive) {
31-
// set default template for tsdown
32-
if (!templateInfo.args.find((arg) => arg.startsWith('--template') || arg.startsWith('-t'))) {
30+
// create-tsdown doesn't support non-interactive mode;
31+
// add default template when running silently to prevent hang on piped stdin
32+
if (!templateInfo.interactive || options?.silent) {
33+
if (!templateInfo.args.some((arg) => arg.startsWith('--template') || arg.startsWith('-t'))) {
3334
templateInfo.args.push('--template', 'default');
3435
}
3536
}

0 commit comments

Comments
 (0)