Skip to content

Commit 7cd013c

Browse files
committed
fix(@schematics/angular): undefined is used as newProjectRoot when none is set
Fixes angular#13703
1 parent 33bade7 commit 7cd013c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/schematics/angular/application/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ export default function (options: ApplicationOptions): Rule {
324324
};
325325

326326
const workspace = getWorkspace(host);
327-
let newProjectRoot = workspace.newProjectRoot;
327+
let newProjectRoot = workspace.newProjectRoot || 'projects';
328328
let appDir = `${newProjectRoot}/${options.name}`;
329329
let sourceRoot = `${appDir}/src`;
330330
let sourceDir = `${sourceRoot}/app`;

packages/schematics/angular/library/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export default function (options: LibraryOptions): Rule {
193193
}
194194

195195
const workspace = getWorkspace(host);
196-
const newProjectRoot = workspace.newProjectRoot;
196+
const newProjectRoot = workspace.newProjectRoot || 'projects';
197197

198198
const scopeFolder = scopeName ? strings.dasherize(scopeName) + '/' : '';
199199
const folderName = `${scopeFolder}${strings.dasherize(options.name)}`;

0 commit comments

Comments
 (0)