Skip to content

Commit

Permalink
Update boolean options. Closes #267
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Feb 18, 2022
1 parent 0b80410 commit 61fdf19
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,22 +92,26 @@ const checkBoolean = value => value && value !== 'false' ? true : false;

export const initPlugin = async(opts = {}) => {
printRow('Start project creation...');
opts.components = checkBoolean(opts.components);
opts.blocks = checkBoolean(opts.blocks);
opts.i18n = checkBoolean(opts.i18n);

const tasks = new Listr([
{
title: 'Creating initial source files',
task: () => createSourceFiles(opts),
}, {
title: 'Creating custom Component Type file',
task: () => createFileComponents(opts),
enabled: () => checkBoolean(opts.components),
enabled: () => opts.components,
}, {
title: 'Creating Blocks file',
task: () => createFileBlocks(opts),
enabled: () => checkBoolean(opts.blocks),
enabled: () => opts.blocks,
}, {
title: 'Creating i18n structure',
task: () => createI18n(opts),
enabled: () => checkBoolean(opts.i18n),
enabled: () => opts.i18n,
}, {
title: 'Update package.json',
task: () => createPackage(opts),
Expand Down

0 comments on commit 61fdf19

Please sign in to comment.