Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): allow parsing dot notation cli args #9812

Merged
merged 1 commit into from Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 24 additions & 0 deletions packages/nx/src/command-line/nx-commands.spec.ts
@@ -0,0 +1,24 @@
import { commandsObject } from 'nx/src/command-line/nx-commands';

describe('nx-commands', () => {
it('should parse dot notion cli args', () => {
const actual = commandsObject.parse(
'nx e2e project-e2e --env.NX_API_URL=http://localhost:4200 --abc.123.xyx=false --a.b=3'
);
expect(actual).toEqual(
expect.objectContaining({
abc: {
'123': {
xyx: 'false',
},
},
a: {
b: 3,
},
env: {
NX_API_URL: 'http://localhost:4200',
},
})
);
});
});
3 changes: 2 additions & 1 deletion packages/nx/src/command-line/nx-commands.ts
Expand Up @@ -25,7 +25,8 @@ yargs.wrap(yargs.terminalWidth());
export const commandsObject = yargs
.parserConfiguration({
'strip-dashed': true,
'dot-notation': false,
// allow parsing --env.SOME_ARG for cypress cli env args
'dot-notation': true,
barbados-clemens marked this conversation as resolved.
Show resolved Hide resolved
})
.usage(
`
Expand Down