organize code

This commit is contained in:
Aman Varshney
2025-02-20 19:14:28 +05:30
parent 9032a598d0
commit f804a9efda
16 changed files with 451 additions and 282 deletions

View 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;
}