CLI: do not breed duplicate eof newlines #325

This commit is contained in:
Einar Lielmanis 2013-09-10 08:02:41 +03:00
parent 790f07a2bb
commit 7693fc8c81

View File

@ -256,7 +256,9 @@ function makePretty(code, config, outfile, callback) {
var pretty = beautify[fileType](code, config); var pretty = beautify[fileType](code, config);
// ensure newline at end of beautified output // ensure newline at end of beautified output
pretty += '\n'; if (pretty && pretty.charAt(pretty.length - 1) !== '\n') {
pretty += '\n';
}
callback(null, pretty, outfile, config); callback(null, pretty, outfile, config);
} catch (ex) { } catch (ex) {