Skip to content

Commit

Permalink
fix(schematics): rely sourceRoot to get the project path (#2292)
Browse files Browse the repository at this point in the history
  • Loading branch information
aitboudad committed Jun 1, 2020
1 parent 7ef2b8e commit 46885e9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/schematics/src/ng-add/index_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe('ng-add-schematic', () => {
`);

const tree = schematicRunner.runSchematic('ng-add', {
module: 'foo.module.ts',
module: 'app/foo.module.ts',
}, appTree);

const content = tree.readContent(fooModule);
Expand Down
2 changes: 1 addition & 1 deletion src/schematics/src/wrapper-component/index_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ xdescribe('Component Schematic', () => {
const collectionPath = join(__dirname, '../collection.json');
const defaultOptions: ComponentOptions = {
name: 'foo',
// path: 'src/app',
path: 'src/app',
inlineStyle: false,
inlineTemplate: false,
changeDetection: ChangeDetection.Default,
Expand Down
2 changes: 1 addition & 1 deletion src/schematics/utils/ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export function findModuleFromOptions(host: Tree, options: any) {
const project = workspace.projects[options.project];

if (options.path === undefined) {
options.path = `/${project.root}/src/app`;
options.path = `/${project.sourceRoot}`;
}

return internalFindModule(host, options);
Expand Down

0 comments on commit 46885e9

Please sign in to comment.