refactor: rename `resolveConfig` with `logResolvedConfigPathOrDie`
parent
d139006c98
commit
18782f77cb
|
@ -130,12 +130,12 @@ function handleError(filename, e) {
|
|||
process.exitCode = 2;
|
||||
}
|
||||
|
||||
function resolveConfig(filePath) {
|
||||
function logResolvedConfigPathOrDie(filePath) {
|
||||
const configFile = resolver.resolveConfigFile.sync(filePath);
|
||||
if (configFile) {
|
||||
console.log(path.relative(process.cwd(), configFile));
|
||||
} else {
|
||||
process.exitCode = 1;
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -393,7 +393,7 @@ function formatFiles(argv) {
|
|||
}
|
||||
|
||||
module.exports = {
|
||||
resolveConfig,
|
||||
logResolvedConfigPathOrDie,
|
||||
format,
|
||||
formatStdin,
|
||||
formatFiles
|
||||
|
|
|
@ -28,7 +28,7 @@ function run(args) {
|
|||
const useStdin = argv["stdin"] || (!hasFilePatterns && !process.stdin.isTTY);
|
||||
|
||||
if (argv["find-config-path"]) {
|
||||
util.resolveConfig(argv["find-config-path"]);
|
||||
util.logResolvedConfigPathOrDie(argv["find-config-path"]);
|
||||
} else if (useStdin) {
|
||||
util.formatStdin(argv);
|
||||
} else if (hasFilePatterns) {
|
||||
|
|
Loading…
Reference in New Issue