Skip to content

Commit

Permalink
fix: always honor process.env.LINGUI_CONFIG (#1447)
Browse files Browse the repository at this point in the history
  • Loading branch information
timofei-iatsenko authored Feb 20, 2023
1 parent 469a1ff commit 4aa80de
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/lingui-extract-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ if (require.main === module) {
const options = program.opts<CliOptions>()

const config = getConfig({
configPath: options.config || process.env.LINGUI_CONFIG,
configPath: options.config,
})

const result = command(config, {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/lingui-extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ if (require.main === module) {
const options = program.opts<CliOptions>()

const config = getConfig({
configPath: options.config || process.env.LINGUI_CONFIG,
configPath: options.config,
})

let hasErrors = false
Expand Down
2 changes: 2 additions & 0 deletions packages/conf/src/getConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ export function getConfig({
},
})

configPath = configPath || process.env.LINGUI_CONFIG

const result = configExists(configPath)
? configExplorer.load(configPath)
: configExplorer.search(defaultRootDir)
Expand Down
2 changes: 1 addition & 1 deletion packages/macro/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function getConfig(_config?: LinguiConfigNormalized) {
config = _config
}
if (!config) {
config = loadConfig({ configPath: process.env.LINGUI_CONFIG })
config = loadConfig()
}
return config
}
Expand Down

0 comments on commit 4aa80de

Please sign in to comment.