Skip to content

Commit

Permalink
Streamline loading config p2
Browse files Browse the repository at this point in the history
  • Loading branch information
kemmerle committed Dec 19, 2024
1 parent ab3c51f commit df81f4f
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,17 +164,13 @@ const loadConfigMiddleware = async options => {
};

// Load the new config and check for the conflicting config flag
if (configFileExists(true)) {
loadConfig('', options);

if (options.config) {
logger.error(
i18n(`${i18nKey}.loadConfigMiddleware.configFileExists`, {
configPath: getConfigPath(),
})
);
process.exit(EXIT_CODES.ERROR);
}
if (configFileExists(true) && options.config) {
logger.error(
i18n(`${i18nKey}.loadConfigMiddleware.configFileExists`, {
configPath: getConfigPath(),
})
);
process.exit(EXIT_CODES.ERROR);
} else {
// We need to load the config when options.config exists,
// so that getAccountIdFromConfig() in injectAccountIdMiddleware reads from the right config
Expand Down

0 comments on commit df81f4f

Please sign in to comment.