Skip to content

Commit 61fdf19

Browse files
committed
Update boolean options. Closes #267
1 parent 0b80410 commit 61fdf19

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/init.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,22 +92,26 @@ const checkBoolean = value => value && value !== 'false' ? true : false;
9292

9393
export const initPlugin = async(opts = {}) => {
9494
printRow('Start project creation...');
95+
opts.components = checkBoolean(opts.components);
96+
opts.blocks = checkBoolean(opts.blocks);
97+
opts.i18n = checkBoolean(opts.i18n);
98+
9599
const tasks = new Listr([
96100
{
97101
title: 'Creating initial source files',
98102
task: () => createSourceFiles(opts),
99103
}, {
100104
title: 'Creating custom Component Type file',
101105
task: () => createFileComponents(opts),
102-
enabled: () => checkBoolean(opts.components),
106+
enabled: () => opts.components,
103107
}, {
104108
title: 'Creating Blocks file',
105109
task: () => createFileBlocks(opts),
106-
enabled: () => checkBoolean(opts.blocks),
110+
enabled: () => opts.blocks,
107111
}, {
108112
title: 'Creating i18n structure',
109113
task: () => createI18n(opts),
110-
enabled: () => checkBoolean(opts.i18n),
114+
enabled: () => opts.i18n,
111115
}, {
112116
title: 'Update package.json',
113117
task: () => createPackage(opts),

0 commit comments

Comments
 (0)