Fix overwriting bug.
This commit is contained in:
@@ -50,11 +50,11 @@ function main (args) {
|
|||||||
var source = '';
|
var source = '';
|
||||||
if (options.file) {
|
if (options.file) {
|
||||||
var path = require('path').join(process.cwd(), options.file);
|
var path = require('path').join(process.cwd(), options.file);
|
||||||
source = fs.readFileSync(path, "utf8");
|
source = parse(fs.readFileSync(path, "utf8"));
|
||||||
if (options.inplace) {
|
if (options.inplace) {
|
||||||
fs.writeSync(fs.openSync(path,'w+'), parse(source), 0, "utf8");
|
fs.writeSync(fs.openSync(path,'w+'), source, 0, "utf8");
|
||||||
} else {
|
} else {
|
||||||
sys.puts(parse(source));
|
sys.puts(source);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var stdin = process.openStdin();
|
var stdin = process.openStdin();
|
||||||
|
|||||||
Reference in New Issue
Block a user