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) {
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 ( `
7676It 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
You can’t perform that action at this time.
0 commit comments