Skip to content

Commit

Permalink
fix(core): fix undefined projectName in tasks runner
Browse files Browse the repository at this point in the history
ISSUES CLOSED: #13018
  • Loading branch information
eric.zhang committed Nov 7, 2022
1 parent 39518e3 commit 371f744
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions packages/nx/src/tasks-runner/utils.spec.ts
Expand Up @@ -40,15 +40,20 @@ describe('utils', () => {
)
).toEqual([]);
});
it('should interpolate {workspaceRoot} and {projectRoot}', () => {

it('should interpolate {workspaceRoot}, {projectRoot} and {projectName}', () => {
expect(
getOutputsForTargetAndConfiguration(
task,
getNode({
outputs: ['{workspaceRoot}/one', '{projectRoot}/two'],
outputs: [
'{workspaceRoot}/one',
'{projectRoot}/two',
'{projectName}/three',
],
})
)
).toEqual(['one', 'myapp/two']);
).toEqual(['one', 'myapp/two', 'myapp/three']);
});

it('should interpolate {projectRoot} when it is not in front', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/nx/src/tasks-runner/utils.ts
Expand Up @@ -157,8 +157,8 @@ export function getOutputsForTargetAndConfiguration(
.map((output: string) => {
return interpolate(output, {
projectRoot: node.data.root,
projectName: node.data.name,
project: { ...node.data, name: node.data.name }, // this is legacy
projectName: node.name,
project: { ...node.data, name: node.name }, // this is legacy
options,
});
})
Expand Down

0 comments on commit 371f744

Please sign in to comment.