Skip to content

Commit fad08f6

Browse files
committed
fix(core): adjust experience generator
1 parent 3d84cfc commit fad08f6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ export default async function (tree: Tree, { project }: Schema) {
6767

6868
if (generateExperience !== 'none') {
6969
const isNx = tree.exists('nx.json');
70-
const rootProjectJson = readJson(tree, 'project.json');
7170

7271
if (!project) {
7372
if (isNx) {
73+
const rootProjectJson = readJson(tree, 'project.json');
7474
if (!rootProjectJson) {
7575
throw new Error(`
7676
It seems like your workspace is an Integrated workspace but you did not provide a "project" name.
@@ -80,6 +80,14 @@ Please retry the generator with a "--project" specified.`);
8080
if (rootName === packageJson['name']) {
8181
project = rootName;
8282
}
83+
} else {
84+
const angularJson = readJson(tree, 'angular.json');
85+
if (!angularJson) {
86+
throw new Error(`
87+
Cannot find "angular.json" file.
88+
Please retry the generator with a "--project" specified in an Angular workspace.`);
89+
}
90+
project = packageJson['name'];
8391
}
8492
}
8593

0 commit comments

Comments
 (0)