Skip to content

Commit

Permalink
Pass context.command
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Jan 23, 2022
1 parent 0910cc7 commit 455f35e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/config/normalize/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import { COMMANDS_PROPS } from './properties.js'
// validation.
export const normalizeConfig = async function (config, command, configInfos) {
const definitions = COMMANDS_PROPS[command]
const context = getContext(configInfos)
const context = getContext(command, configInfos)
const configA = await normalizeConfigProps(config, definitions, { context })
const configB = postNormalizeConfig(configA)
return configB
}

const getContext = function (configInfos) {
const getContext = function (command, configInfos) {
// eslint-disable-next-line fp/no-mutating-methods
const configInfosA = [...configInfos].reverse()
return { configInfos: configInfosA }
return { command, configInfos: configInfosA }
}

// Perform normalization that is difficult to do with the main configuration
Expand Down

0 comments on commit 455f35e

Please sign in to comment.