Skip to content

Commit 220c3fe

Browse files
hanslBrocco
authored andcommitted
fix(@angular/cli): add appRoot to generate
This depends on angular/devkit#149 Fixes #7695
1 parent b5d3204 commit 220c3fe

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/@angular/cli/commands/generate.ts

+4
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,11 @@ export default Command.extend({
137137
dryRun: commandOptions.dryRun
138138
};
139139
const parsedPath = dynamicPathParser(dynamicPathOptions);
140+
const root = appConfig.root + path.sep;
140141
commandOptions.sourceDir = appConfig.root;
142+
commandOptions.appRoot = parsedPath.appRoot.startsWith(root)
143+
? parsedPath.appRoot.substr(root.length)
144+
: parsedPath.appRoot;
141145
commandOptions.path = parsedPath.dir
142146
.replace(appConfig.root + path.sep, '')
143147
.replace(separatorRegEx, '/');

0 commit comments

Comments
 (0)