Skip to content

Commit

Permalink
fix(@schematics/angular): default newProjectRoot to current directory
Browse files Browse the repository at this point in the history
  • Loading branch information
clydin authored and mgechev committed Feb 26, 2019
1 parent 324b256 commit 4e9e8b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/schematics/angular/application/index.ts
Expand Up @@ -151,7 +151,7 @@ function addAppToWorkspaceFile(options: ApplicationOptions, workspace: Workspace
// }
let projectRoot = options.projectRoot !== undefined
? options.projectRoot
: `${workspace.newProjectRoot}/${options.name}`;
: `${workspace.newProjectRoot || ''}/${options.name}`;
if (projectRoot !== '' && !projectRoot.endsWith('/')) {
projectRoot += '/';
}
Expand Down Expand Up @@ -326,7 +326,7 @@ export default function (options: ApplicationOptions): Rule {
};

const workspace = getWorkspace(host);
let newProjectRoot = workspace.newProjectRoot || 'projects';
let newProjectRoot = workspace.newProjectRoot || '';
let appDir = `${newProjectRoot}/${options.name}`;
let sourceRoot = `${appDir}/src`;
let sourceDir = `${sourceRoot}/app`;
Expand Down
2 changes: 1 addition & 1 deletion packages/schematics/angular/library/index.ts
Expand Up @@ -193,7 +193,7 @@ export default function (options: LibraryOptions): Rule {
}

const workspace = getWorkspace(host);
const newProjectRoot = workspace.newProjectRoot || 'projects';
const newProjectRoot = workspace.newProjectRoot || '';

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

0 comments on commit 4e9e8b7

Please sign in to comment.