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
  • Loading branch information
FrozenPandaz committed Nov 30, 2022
1 parent b9b4b2b commit a1bac90
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

1 comment on commit a1bac90

@vercel
Copy link

@vercel vercel bot commented on a1bac90 Nov 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx.dev
nx-dev-nrwl.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx-five.vercel.app

Please sign in to comment.