commit
fd852320ce
|
@ -39,14 +39,21 @@ filenames.forEach(filename => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const output = jscodefmt.format(input, {
|
let output;
|
||||||
printWidth: argv["print-width"],
|
try {
|
||||||
tabWidth: argv["tab-width"],
|
output = jscodefmt.format(input, {
|
||||||
bracketSpacing: argv["bracket-spacing"],
|
printWidth: argv["print-width"],
|
||||||
useFlowParser: argv["flow-parser"],
|
tabWidth: argv["tab-width"],
|
||||||
singleQuote: argv["single-quote"],
|
bracketSpacing: argv["bracket-spacing"],
|
||||||
trailingComma: argv["trailing-comma"]
|
useFlowParser: argv["flow-parser"],
|
||||||
});
|
singleQuote: argv["single-quote"],
|
||||||
|
trailingComma: argv["trailing-comma"]
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
process.exitCode = 2;
|
||||||
|
console.error(e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (write) {
|
if (write) {
|
||||||
fs.writeFile(filename, output, "utf8", err => {
|
fs.writeFile(filename, output, "utf8", err => {
|
||||||
|
|
Loading…
Reference in New Issue