Test babel-cli --source-maps and errors (#5377)
This commit is contained in:
@@ -162,20 +162,20 @@ export default function parseArgv(args: Array<string>) {
|
||||
|
||||
filenames.forEach(function(filename) {
|
||||
if (!fs.existsSync(filename)) {
|
||||
errors.push(filename + " doesn't exist");
|
||||
errors.push(filename + " does not exist");
|
||||
}
|
||||
});
|
||||
|
||||
if (commander.outDir && !filenames.length) {
|
||||
errors.push("filenames required for --out-dir");
|
||||
errors.push("--out-dir requires filenames");
|
||||
}
|
||||
|
||||
if (commander.outFile && commander.outDir) {
|
||||
errors.push("cannot have --out-file and --out-dir");
|
||||
errors.push("--out-file and --out-dir cannot be used together");
|
||||
}
|
||||
|
||||
if (commander.relative && !commander.outDir) {
|
||||
errors.push("output directory required for --relative");
|
||||
errors.push("--relative requires --out-dir usage");
|
||||
}
|
||||
|
||||
if (commander.watch) {
|
||||
@@ -207,7 +207,10 @@ export default function parseArgv(args: Array<string>) {
|
||||
}
|
||||
|
||||
if (errors.length) {
|
||||
console.error(errors.join(". "));
|
||||
console.error("babel:");
|
||||
errors.forEach(function (e) {
|
||||
console.error(" " + e);
|
||||
});
|
||||
process.exit(2);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user