Skip to content

Commit

Permalink
feat: auto lowercase, include y/n for confirmation prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
kirinnee committed Jan 3, 2025
1 parent c1e866d commit 0c7f6c2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 9 additions & 3 deletions cyan/functions/atomi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,16 @@ function SimpleCopy(vars: Record<string, string | boolean>, ...files: CyanGlob[]
export async function atomiPrompt(i: IInquirer, d: IDeterminism): Promise<Cyan> {
const runtime = await i.select('Runtime', ['Go', '.NET', 'Bun'], 'Runtime to setup with Nix');

const platform = await i.text('Platform', 'LPSM Service Tree Platform');
const service = await i.text('Service', 'LPSM Service Tree Service');
const p = await i.text('Platform', 'LPSM Service Tree Platform');
const s = await i.text('Service', 'LPSM Service Tree Service');

const infra = await i.confirm('Infrastructure', 'Include infrastructure binaries like helm, k3d, kubectl and docker');
const platform = p.charAt(0).toUpperCase() + p.slice(1).toLowerCase();
const service = s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();

const infra = await i.confirm(
'Infrastructure (y/n)',
'Include infrastructure binaries like helm, k3d, kubectl and docker',
);
const vars: Record<string, string | boolean> = { platform, service, infra };

if (runtime == 'Go') {
Expand Down
4 changes: 2 additions & 2 deletions cyan/functions/normal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export async function normalPrompt(i: IInquirer, d: IDeterminism): Promise<Cyan>

vars.description = await i.text('Description', 'Description of this Project');

const standard = await i.confirm('Include default binaries');
const pc = await i.confirm('Include Pre-Commit Hooks');
const standard = await i.confirm('Include default binaries (y/n)');
const pc = await i.confirm('Include Pre-Commit Hooks (y/n)');

const folder = standard ? 'templates/normal/standard' : 'templates/normal/empty';
const folderExclude = pc ? [] : ['**/pre-commit.nix', '**/fmt.nix'];
Expand Down

0 comments on commit 0c7f6c2

Please sign in to comment.