Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pgpm/cli/src/commands/init/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ async function handleModuleInit(
answers: templateAnswers,
noTty: ctx.noTty,
pgpm: isPgpmTemplate,
prompter,
});

const isRoot = path.resolve(project.workspacePath) === path.resolve(ctx.cwd);
Expand Down
10 changes: 9 additions & 1 deletion pgpm/core/src/core/class/pgpm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ export interface InitModuleOptions {
* Defaults to true for backward compatibility.
*/
pgpm?: boolean;
/**
* Optional Inquirerer instance to reuse for prompting during template scaffolding.
* If provided, prevents creating a duplicate instance on process.stdin which
* would cause double-echoed keystrokes and other input conflicts.
* The caller retains ownership and is responsible for closing it.
*/
prompter?: import('inquirerer').Inquirerer;
}

export class PgpmPackage {
Expand Down Expand Up @@ -476,7 +483,8 @@ export class PgpmPackage {
noTty: options.noTty ?? false,
cacheTtlMs: options.cacheTtlMs ?? DEFAULT_TEMPLATE_TTL_MS,
toolName: options.toolName ?? DEFAULT_TEMPLATE_TOOL_NAME,
cwd: this.cwd
cwd: this.cwd,
prompter: options.prompter,
});

// Only create pgpm files (pgpm.plan, .control, deploy/revert/verify dirs) for pgpm-managed modules
Expand Down