diff options
author | anekos | 2010-03-20 11:06:47 +0000 |
---|---|---|
committer | anekos | 2010-03-20 11:06:47 +0000 |
commit | a9496e301fbd756899038a96079a023d58f5d3fa (patch) | |
tree | c5373786fd3aa59a192a3280f57b992c42b60a83 /reporter.js | |
parent | 770e61fc9e96a455312be8597194804ead5d34cd (diff) | |
download | vimperator-plugins-a9496e301fbd756899038a96079a023d58f5d3fa.tar.bz2 |
既存の時は削除する様に
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@37063 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'reporter.js')
-rwxr-xr-x | reporter.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/reporter.js b/reporter.js index 962bbc1..cce9552 100755 --- a/reporter.js +++ b/reporter.js @@ -62,7 +62,10 @@ let PLUGIN_INFO = let out = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream); let conv = Cc['@mozilla.org/intl/converter-output-stream;1']. createInstance(Ci.nsIConverterOutputStream); - let file = File(path); + let file = File(io.expandPath(path)); + + if (file.exists()) + file.remove(false); localFile.initWithPath(file.path); out.init(localFile, 0x02 | 0x08, 0664, 0); @@ -142,16 +145,14 @@ let PLUGIN_INFO = let value = options.getPref(name); if (typeof value === 'string' && limit && value.length > limit) continue; - file.write("set! " + name + "=" + quote(value)); + file.writeln("set! " + name + "=" + quote(value)); } }, addons: function (file) { for each (let ext in liberator.extensions) { - file.write( - ext.name + ' ' + - (ext.enabled ? 'enabled' : 'disabled') - ); + file.writeln(ext.name); + file.writeln(' ' + (ext.enabled ? 'enabled' : 'disabled')); } } }; |