Skip to content

Commit

Permalink
fix(generators): update path builder (#275)
Browse files Browse the repository at this point in the history
make sure path builder sets the options correctly

Closes #274
  • Loading branch information
mhartington authored Aug 24, 2020
1 parent f7fb5c6 commit 1393e8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 2 additions & 4 deletions schematics/component/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,11 @@ export default function(options: ComponentOptions): Rule {

const workspace = await getWorkspace(host);
const project = workspace.projects.get(options.project);

let optPath = '';
if (project && options.path === undefined) {
optPath = buildDefaultPath(project);
options.path = buildDefaultPath(project);
}

const parsedPath = parseName(optPath, options.name);
const parsedPath = parseName(options.path as string, options.name);
options.name = parsedPath.name;
options.path = parsedPath.path;
options.selector = options.selector ? options.selector : buildSelector(options, project?.prefix ?? 'app');
Expand Down
5 changes: 2 additions & 3 deletions schematics/page/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,13 @@ export default function(options: PageOptions): Rule {

const workspace = await getWorkspace(host);
const project = workspace.projects.get(options.project);
let optPath = '';
if (project && options.path === undefined) {
optPath = buildDefaultPath(project);
options.path = buildDefaultPath(project);
}

options.module = findRoutingModuleFromOptions(host, options);

const parsedPath = parseName(optPath, options.name);
const parsedPath = parseName(options.path as string, options.name);
options.name = parsedPath.name;
options.path = parsedPath.path;
options.selector = options.selector ? options.selector : buildSelector(options, project?.prefix ?? 'app');
Expand Down

0 comments on commit 1393e8c

Please sign in to comment.