mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
22 lines
503 B
TypeScript
22 lines
503 B
TypeScript
import { cancel, confirm, isCancel } from "@clack/prompts";
|
|
import pc from "picocolors";
|
|
import { DEFAULT_CONFIG } from "../constants";
|
|
|
|
export async function getNoInstallChoice(
|
|
noInstall?: boolean,
|
|
): Promise<boolean> {
|
|
if (noInstall !== undefined) return noInstall;
|
|
|
|
const response = await confirm({
|
|
message: "Install dependencies?",
|
|
initialValue: !DEFAULT_CONFIG.noInstall,
|
|
});
|
|
|
|
if (isCancel(response)) {
|
|
cancel(pc.red("Operation cancelled"));
|
|
process.exit(0);
|
|
}
|
|
|
|
return !response;
|
|
}
|