Capi Etheriel 2013-02-19 18:16:05 -03:00 committed by Ariya Hidayat
parent 04368c6af8
commit ca27a8eab1
2 changed files with 3 additions and 6 deletions

View File

@ -13,8 +13,7 @@ else
content += system.args[i] + (if i == system.args.length - 1 then "" else " ")
++i
try
f = fs.open(system.args[1], "w")
f.writeLine content
fs.write system.args[1], content, "w"
catch e
console.log e
phantom.exit()

View File

@ -14,10 +14,8 @@ if (system.args.length < 3) {
}
try {
f = fs.open(system.args[1], "w");
f.writeLine(content);
f.close();
} catch (e) {
fs.write(system.args[1], content, 'w');
} catch(e) {
console.log(e);
}