Skip to content

Commit 7b31c86

Browse files
ahasallKeen Yee Liau
authored andcommitted
fix(@schematics/angular): undefined is used as newProjectRoot when none is set
Fixes #13703
1 parent 9e6e47e commit 7b31c86

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/schematics/angular/application/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ export default function (options: ApplicationOptions): Rule {
326326
};
327327

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

packages/schematics/angular/library/index.ts

Lines changed: 1 addition & 1 deletion
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)