Skip to content

Commit

Permalink
fix(@angular/cli): add appRoot to generate
Browse files Browse the repository at this point in the history
This depends on angular/devkit#149

Fixes #7695
  • Loading branch information
hansl authored and Brocco committed Sep 22, 2017
1 parent b5d3204 commit 220c3fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/@angular/cli/commands/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ export default Command.extend({
dryRun: commandOptions.dryRun
};
const parsedPath = dynamicPathParser(dynamicPathOptions);
const root = appConfig.root + path.sep;
commandOptions.sourceDir = appConfig.root;
commandOptions.appRoot = parsedPath.appRoot.startsWith(root)
? parsedPath.appRoot.substr(root.length)
: parsedPath.appRoot;
commandOptions.path = parsedPath.dir
.replace(appConfig.root + path.sep, '')
.replace(separatorRegEx, '/');
Expand Down

0 comments on commit 220c3fe

Please sign in to comment.