mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
organize code
This commit is contained in:
19
apps/cli/src/prompts/git.ts
Normal file
19
apps/cli/src/prompts/git.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
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 a new git repository?",
|
||||
initialValue: DEFAULT_CONFIG.git,
|
||||
});
|
||||
|
||||
if (isCancel(response)) {
|
||||
cancel(pc.red("Operation cancelled"));
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
Reference in New Issue
Block a user