Skip to content

Commit

Permalink
Address feedback p1
Browse files Browse the repository at this point in the history
  • Loading branch information
kemmerle committed Dec 19, 2024
1 parent 47028a4 commit c3fd8cc
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,8 @@ const loadConfigMiddleware = async options => {
command =>
!(NO_CONFIG_VALIDATION[command] && NO_CONFIG_VALIDATION[command].skip)
);
if (shouldValidate) {
if (!validateConfig()) {
process.exit(EXIT_CODES.ERROR);
}
if (shouldValidate && !validateConfig()) {
process.exit(EXIT_CODES.ERROR);
}
};

Expand All @@ -179,23 +177,17 @@ const loadConfigMiddleware = async options => {
);
process.exit(EXIT_CODES.ERROR);
}
maybeValidateConfig();
return;
}

// We need to load the config when options.config exists,
// so that getAccountIdFromConfig() in injectAccountIdMiddleware reads from the right config
if (options.config && fs.existsSync(options.config)) {
} else if (options.config && fs.existsSync(options.config)) {
// We need to load the config when options.config exists,
// so that getAccountIdFromConfig() in injectAccountIdMiddleware reads from the right config
const { config: configPath } = options;
loadConfig(configPath, options);
maybeValidateConfig();
return;
} else {
// Load deprecated config without a config flag and with no warnings
getAndLoadConfigIfNeeded(options);
}

// Load deprecated config without a config flag and with no warnings
getAndLoadConfigIfNeeded(options);
maybeValidateConfig();
return;
};

const checkAndWarnGitInclusionMiddleware = () => {
Expand Down

0 comments on commit c3fd8cc

Please sign in to comment.