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