Skip to content

Commit 2b4c9fa

Browse files
committed
fix(core): force standalone for experience generation
1 parent f259b43 commit 2b4c9fa

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

libs/plugin/src/generators/init/generator.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,21 @@ Please retry the generator with a "--project" specified.`);
100100
// generate Experience component
101101
generateFiles(tree, join(__dirname, 'files'), sourceRoot, { tmpl: '' });
102102

103-
const { isStandalone } = await prompt<{ isStandalone: boolean }>({
104-
type: 'confirm',
105-
initial: false,
106-
name: 'isStandalone',
107-
message: 'Is your project standalone?',
108-
});
103+
let isStandalone = false;
104+
105+
while (!isStandalone) {
106+
const answer = await prompt<{ isStandalone: boolean }>({
107+
type: 'confirm',
108+
initial: true,
109+
name: 'isStandalone',
110+
message: 'Is your project standalone?',
111+
});
112+
isStandalone = answer.isStandalone;
113+
if (!isStandalone) {
114+
logger.info(`Wrong answer. You should be using Standalone.`);
115+
}
116+
}
117+
109118
const appComponentPath = `${sourceRoot}/app.component.ts`;
110119
const exist = tree.exists(appComponentPath);
111120
const appComponentTemplatePath = `${sourceRoot}/app.component.html`;
@@ -178,7 +187,6 @@ ${node.getFullText()}
178187

179188
tree.write(appComponentPath, updatedContent);
180189
}
181-
} else {
182190
}
183191
} else {
184192
logger.warn(`

0 commit comments

Comments
 (0)