mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-09 03:54:11 +01:00
@@ -585,8 +585,9 @@ var Buffer = Module("Buffer", {
|
||||
* Saves a page link to disk.
|
||||
*
|
||||
* @param {HTMLAnchorElement} elem The page link to save.
|
||||
* @param {boolean} overwrite If true, overwrite any existing file.
|
||||
*/
|
||||
saveLink: function saveLink(elem) {
|
||||
saveLink: function saveLink(elem, overwrite) {
|
||||
let { completion, dactyl, io } = this.modules;
|
||||
|
||||
let self = this;
|
||||
@@ -604,6 +605,8 @@ var Buffer = Module("Buffer", {
|
||||
if (file.exists() && file.isDirectory())
|
||||
file.append(Buffer.getDefaultNames(elem)[0][0]);
|
||||
|
||||
util.assert(!file.exists() || overwrite, _("io.existsNoOverride", file.path));
|
||||
|
||||
try {
|
||||
if (!file.exists())
|
||||
file.create(File.NORMAL_FILE_TYPE, octal(644));
|
||||
|
||||
Reference in New Issue
Block a user