Skip to content

Commit

Permalink
fix(core): fix configuration option for affected:build|test|e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz committed Nov 30, 2022
1 parent b9b4b2b commit 8bcadbc
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 @@ -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

0 comments on commit 8bcadbc

Please sign in to comment.