mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-18 20:02:40 +08:00
fix(@schematics/angular): default newProjectRoot to current directory
This commit is contained in:
parent
70b28193c9
commit
b96e7bf76f
@ -151,7 +151,7 @@ function addAppToWorkspaceFile(options: ApplicationOptions, workspace: Workspace
|
|||||||
// }
|
// }
|
||||||
let projectRoot = options.projectRoot !== undefined
|
let projectRoot = options.projectRoot !== undefined
|
||||||
? options.projectRoot
|
? options.projectRoot
|
||||||
: `${workspace.newProjectRoot}/${options.name}`;
|
: `${workspace.newProjectRoot || ''}/${options.name}`;
|
||||||
if (projectRoot !== '' && !projectRoot.endsWith('/')) {
|
if (projectRoot !== '' && !projectRoot.endsWith('/')) {
|
||||||
projectRoot += '/';
|
projectRoot += '/';
|
||||||
}
|
}
|
||||||
@ -326,7 +326,7 @@ export default function (options: ApplicationOptions): Rule {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const workspace = getWorkspace(host);
|
const workspace = getWorkspace(host);
|
||||||
let newProjectRoot = workspace.newProjectRoot || 'projects';
|
let newProjectRoot = workspace.newProjectRoot || '';
|
||||||
let appDir = `${newProjectRoot}/${options.name}`;
|
let appDir = `${newProjectRoot}/${options.name}`;
|
||||||
let sourceRoot = `${appDir}/src`;
|
let sourceRoot = `${appDir}/src`;
|
||||||
let sourceDir = `${sourceRoot}/app`;
|
let sourceDir = `${sourceRoot}/app`;
|
||||||
|
@ -193,7 +193,7 @@ export default function (options: LibraryOptions): Rule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const workspace = getWorkspace(host);
|
const workspace = getWorkspace(host);
|
||||||
const newProjectRoot = workspace.newProjectRoot || 'projects';
|
const newProjectRoot = workspace.newProjectRoot || '';
|
||||||
|
|
||||||
const scopeFolder = scopeName ? strings.dasherize(scopeName) + '/' : '';
|
const scopeFolder = scopeName ? strings.dasherize(scopeName) + '/' : '';
|
||||||
const folderName = `${scopeFolder}${strings.dasherize(options.name)}`;
|
const folderName = `${scopeFolder}${strings.dasherize(options.name)}`;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user