[ci] format

This commit is contained in:
bluwy 2023-09-22 13:20:50 +00:00 committed by astrobot-houston
parent b64dd45c0d
commit f35a55bd4f
2 changed files with 9 additions and 9 deletions

View file

@ -9,11 +9,11 @@ import { error, info, spinner, title } from '../messages.js';
export async function template(
ctx: Pick<Context, 'template' | 'prompt' | 'yes' | 'dryRun' | 'exit'>
) {
if (!ctx.template && ctx.yes) ctx.template = 'basics';
if (!ctx.template && ctx.yes) ctx.template = 'basics';
if (ctx.template) {
await info('tmpl', `Using ${color.reset(ctx.template)}${color.dim(' as project template')}`);
} else {
if (ctx.template) {
await info('tmpl', `Using ${color.reset(ctx.template)}${color.dim(' as project template')}`);
} else {
const { template: tmpl } = await ctx.prompt({
name: 'template',
type: 'select',

View file

@ -34,10 +34,10 @@ describe('template', () => {
expect(fixture.hasMessage('Using blog as project template')).to.be.true;
});
it('minimal (--yes)', async () => {
const context = { template: 'minimal', cwd: '', dryRun: true, yes: true, prompt: () => {} };
await template(context);
it('minimal (--yes)', async () => {
const context = { template: 'minimal', cwd: '', dryRun: true, yes: true, prompt: () => {} };
await template(context);
expect(fixture.hasMessage('Using minimal as project template')).to.be.true;
})
expect(fixture.hasMessage('Using minimal as project template')).to.be.true;
});
});