Skip to content

Commit 1393e8c

Browse files
authored
fix(generators): update path builder (#275)
make sure path builder sets the options correctly Closes #274
1 parent f7fb5c6 commit 1393e8c

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

schematics/component/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,11 @@ export default function(options: ComponentOptions): Rule {
130130

131131
const workspace = await getWorkspace(host);
132132
const project = workspace.projects.get(options.project);
133-
134-
let optPath = '';
135133
if (project && options.path === undefined) {
136-
optPath = buildDefaultPath(project);
134+
options.path = buildDefaultPath(project);
137135
}
138136

139-
const parsedPath = parseName(optPath, options.name);
137+
const parsedPath = parseName(options.path as string, options.name);
140138
options.name = parsedPath.name;
141139
options.path = parsedPath.path;
142140
options.selector = options.selector ? options.selector : buildSelector(options, project?.prefix ?? 'app');

schematics/page/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,13 @@ export default function(options: PageOptions): Rule {
186186

187187
const workspace = await getWorkspace(host);
188188
const project = workspace.projects.get(options.project);
189-
let optPath = '';
190189
if (project && options.path === undefined) {
191-
optPath = buildDefaultPath(project);
190+
options.path = buildDefaultPath(project);
192191
}
193192

194193
options.module = findRoutingModuleFromOptions(host, options);
195194

196-
const parsedPath = parseName(optPath, options.name);
195+
const parsedPath = parseName(options.path as string, options.name);
197196
options.name = parsedPath.name;
198197
options.path = parsedPath.path;
199198
options.selector = options.selector ? options.selector : buildSelector(options, project?.prefix ?? 'app');

0 commit comments

Comments
 (0)