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): fix configuration option for affected:build|test|e2e #13487

Merged
merged 1 commit into from Nov 30, 2022
Merged
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
46 changes: 28 additions & 18 deletions packages/nx/src/command-line/nx-commands.ts
Expand Up @@ -86,7 +86,9 @@ export const commandsObject = yargs
describe: false,
builder: (yargs) =>
linkToNxDevAndExamples(
withAffectedOptions(withRunOptions(withOutputStyleOption(yargs))),
withAffectedOptions(
withRunOptions(withOutputStyleOption(withConfiguration(yargs)))
),
'affected'
),
handler: async (args) =>
Expand All @@ -100,7 +102,9 @@ export const commandsObject = yargs
describe: false,
builder: (yargs) =>
linkToNxDevAndExamples(
withAffectedOptions(withRunOptions(withOutputStyleOption(yargs))),
withAffectedOptions(
withRunOptions(withOutputStyleOption(withConfiguration(yargs)))
),
'affected'
),
handler: async (args) =>
Expand All @@ -114,7 +118,9 @@ export const commandsObject = yargs
describe: false,
builder: (yargs) =>
linkToNxDevAndExamples(
withAffectedOptions(withRunOptions(withOutputStyleOption(yargs))),
withAffectedOptions(
withRunOptions(withOutputStyleOption(withConfiguration(yargs)))
),
'affected'
),
handler: async (args) =>
Expand All @@ -128,7 +134,9 @@ export const commandsObject = yargs
describe: false,
builder: (yargs) =>
linkToNxDevAndExamples(
withAffectedOptions(withRunOptions(withOutputStyleOption(yargs))),
withAffectedOptions(
withRunOptions(withOutputStyleOption(withConfiguration(yargs)))
),
'affected'
),
handler: async (args) =>
Expand Down Expand Up @@ -631,20 +639,22 @@ function withTargetAndConfigurationOption(
yargs: yargs.Argv,
demandOption = true
): yargs.Argv {
return yargs
.option('target', {
describe: 'Task to run for affected projects',
type: 'string',
requiresArg: true,
demandOption,
global: false,
})
.options('configuration', {
describe:
'This is the configuration to use when performing tasks on projects',
type: 'string',
alias: 'c',
});
return withConfiguration(yargs).option('target', {
describe: 'Task to run for affected projects',
type: 'string',
requiresArg: true,
demandOption,
global: false,
});
}

function withConfiguration(yargs: yargs.Argv) {
return yargs.options('configuration', {
describe:
'This is the configuration to use when performing tasks on projects',
type: 'string',
alias: 'c',
});
}

function withNewOptions(yargs: yargs.Argv) {
Expand Down