Refactor CLI into modules for web provider and utils

This commit is contained in:
Peter Steinberger
2025-11-24 17:43:37 +01:00
parent f88b3ceb7a
commit cafca5c421
4 changed files with 243 additions and 201 deletions

29
src/globals.ts Normal file
View File

@@ -0,0 +1,29 @@
import chalk from "chalk";
let globalVerbose = false;
let globalYes = false;
export function setVerbose(v: boolean) {
globalVerbose = v;
}
export function isVerbose() {
return globalVerbose;
}
export function logVerbose(message: string) {
if (globalVerbose) console.log(chalk.gray(message));
}
export function setYes(v: boolean) {
globalYes = v;
}
export function isYes() {
return globalYes;
}
export const success = chalk.green;
export const warn = chalk.yellow;
export const info = chalk.cyan;
export const danger = chalk.red;