Skip to content

Commit

Permalink
fix(core): fix configuration option for affected:build|test|e2e (#13487)
Browse files Browse the repository at this point in the history
(cherry picked from commit a1bac90)
  • Loading branch information
FrozenPandaz committed Nov 30, 2022
1 parent 66f6a18 commit 9a8505e
Showing 1 changed file with 28 additions and 18 deletions.
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 @@ -622,20 +630,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

0 comments on commit 9a8505e

Please sign in to comment.