From 26d5e1cb15d62f196e2a46aa919ef0774e7af1cd Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 13 Feb 2018 14:02:39 +0100 Subject: [PATCH] add private _exist function to browser-files.js --- src/app/files/browser-files.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/app/files/browser-files.js b/src/app/files/browser-files.js index 3117ff898c..e0a25e6db8 100644 --- a/src/app/files/browser-files.js +++ b/src/app/files/browser-files.js @@ -9,11 +9,15 @@ function Files (storage) { this.type = 'browser' this.exists = function (path, cb) { + cb(null, this._exists(path)) + } + + this._exists = function (path) { var unprefixedpath = this.removePrefix(path) // NOTE: ignore the config file - if (path === '.remix.config') return cb(null, false) + if (path === '.remix.config') return false - return cb(null, this.isReadOnly(unprefixedpath) || storage.exists(unprefixedpath)) + return this.isReadOnly(unprefixedpath) || storage.exists(unprefixedpath) } this.init = function (cb) { @@ -75,7 +79,7 @@ function Files (storage) { this.remove = function (path) { var unprefixedpath = this.removePrefix(path) - if (!this.exists(unprefixedpath)) { + if (!this._exists(unprefixedpath)) { return false } @@ -133,7 +137,7 @@ function Files (storage) { } // rename .browser-solidity.json to .remix.config - if (this.exists('.browser-solidity.json')) { + if (this._exists('.browser-solidity.json')) { this.rename('.browser-solidity.json', '.remix.config') } }