Skip to content

Commit 4e9e8b7

Browse files
clydinmgechev
authored andcommitted
fix(@schematics/angular): default newProjectRoot to current directory
1 parent 324b256 commit 4e9e8b7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/schematics/angular/application/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ function addAppToWorkspaceFile(options: ApplicationOptions, workspace: Workspace
151151
// }
152152
let projectRoot = options.projectRoot !== undefined
153153
? options.projectRoot
154-
: `${workspace.newProjectRoot}/${options.name}`;
154+
: `${workspace.newProjectRoot || ''}/${options.name}`;
155155
if (projectRoot !== '' && !projectRoot.endsWith('/')) {
156156
projectRoot += '/';
157157
}
@@ -326,7 +326,7 @@ export default function (options: ApplicationOptions): Rule {
326326
};
327327

328328
const workspace = getWorkspace(host);
329-
let newProjectRoot = workspace.newProjectRoot || 'projects';
329+
let newProjectRoot = workspace.newProjectRoot || '';
330330
let appDir = `${newProjectRoot}/${options.name}`;
331331
let sourceRoot = `${appDir}/src`;
332332
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 || 'projects';
196+
const newProjectRoot = workspace.newProjectRoot || '';
197197

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

0 commit comments

Comments
 (0)