Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #8326, add back --quiet option. #10399

Merged
merged 3 commits into from Oct 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions packages/babel-cli/src/babel/dir.js
Expand Up @@ -129,11 +129,13 @@ export default async function({
compiledFiles += await handle(filename);
}

console.log(
`Successfully compiled ${compiledFiles} ${
compiledFiles !== 1 ? "files" : "file"
} with Babel.`,
);
if (!cliOptions.quiet) {
console.log(
`Successfully compiled ${compiledFiles} ${
compiledFiles !== 1 ? "files" : "file"
} with Babel.`,
);
}
}

if (cliOptions.watch) {
Expand Down
14 changes: 13 additions & 1 deletion packages/babel-cli/src/babel/options.js
Expand Up @@ -144,7 +144,14 @@ commander.option(
"--include-dotfiles",
"Include dotfiles when compiling and copying non-compilable files",
);
commander.option("--verbose", "Log everything");
commander.option(
"--verbose",
"Log everything. This option conflicts with --quiet",
);
commander.option(
"--quiet",
"Don't log anything. This option conflicts with --verbose",
);
commander.option(
"--delete-dir-on-start",
"Delete the out directory before compilation",
Expand Down Expand Up @@ -207,6 +214,10 @@ export default function parseArgv(args: Array<string>): CmdOptions {
errors.push("--delete-dir-on-start requires --out-dir");
}

if (commander.verbose && commander.quiet) {
errors.push("--verbose and --quiet cannot be used together");
}

if (
!commander.outDir &&
filenames.length === 0 &&
Expand Down Expand Up @@ -282,6 +293,7 @@ export default function parseArgv(args: Array<string>): CmdOptions {
copyFiles: opts.copyFiles,
includeDotfiles: opts.includeDotfiles,
verbose: opts.verbose,
quiet: opts.quiet,
deleteDirOnStart: opts.deleteDirOnStart,
sourceMapTarget: opts.sourceMapTarget,
},
Expand Down