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 2 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
14 changes: 8 additions & 6 deletions packages/babel-cli/src/babel/dir.js
Expand Up @@ -56,7 +56,7 @@ export default async function({
outputFileSync(dest, res.code);
util.chmod(src, dest);

if (cliOptions.verbose) {
if (cliOptions.verbose && !cliOptions.quiet) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to throw if both are enabled

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicolo-ribaudo Will work on it.

console.log(src + " -> " + dest);
}

Expand Down 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
2 changes: 2 additions & 0 deletions packages/babel-cli/src/babel/options.js
Expand Up @@ -145,6 +145,7 @@ commander.option(
"Include dotfiles when compiling and copying non-compilable files",
);
commander.option("--verbose", "Log everything");
commander.option("--quiet", "Don't log anything");
commander.option(
"--delete-dir-on-start",
"Delete the out directory before compilation",
Expand Down Expand Up @@ -282,6 +283,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