mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
feat(cli): add reproducible command output and flag support
This commit is contained in:
30
apps/cli/src/utils/generate-reproducible-command.ts
Normal file
30
apps/cli/src/utils/generate-reproducible-command.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { DEFAULT_CONFIG } from "../consts";
|
||||
import type { ProjectConfig } from "../types";
|
||||
|
||||
export function generateReproducibleCommand(config: ProjectConfig): string {
|
||||
const parts = ["bunx create-better-t-stack"];
|
||||
|
||||
if (config.projectName !== DEFAULT_CONFIG.projectName) {
|
||||
parts.push(config.projectName);
|
||||
}
|
||||
|
||||
if (config.database !== DEFAULT_CONFIG.database) {
|
||||
parts.push(`--database ${config.database}`);
|
||||
}
|
||||
|
||||
if (config.auth !== DEFAULT_CONFIG.auth) {
|
||||
parts.push(config.auth ? "--auth" : "--no-auth");
|
||||
}
|
||||
|
||||
if (config.features.includes("docker")) {
|
||||
parts.push("--docker");
|
||||
}
|
||||
if (config.features.includes("github-actions")) {
|
||||
parts.push("--github-actions");
|
||||
}
|
||||
if (config.features.includes("SEO")) {
|
||||
parts.push("--seo");
|
||||
}
|
||||
|
||||
return parts.join(" ");
|
||||
}
|
||||
Reference in New Issue
Block a user