File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
libs/plugin/src/generators/init Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -67,10 +67,10 @@ export default async function (tree: Tree, { project }: Schema) {
67
67
68
68
if ( generateExperience !== 'none' ) {
69
69
const isNx = tree . exists ( 'nx.json' ) ;
70
- const rootProjectJson = readJson ( tree , 'project.json' ) ;
71
70
72
71
if ( ! project ) {
73
72
if ( isNx ) {
73
+ const rootProjectJson = readJson ( tree , 'project.json' ) ;
74
74
if ( ! rootProjectJson ) {
75
75
throw new Error ( `
76
76
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.`);
80
80
if ( rootName === packageJson [ 'name' ] ) {
81
81
project = rootName ;
82
82
}
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' ] ;
83
91
}
84
92
}
85
93
You can’t perform that action at this time.
0 commit comments