Commit 26d5e1cb authored by yann300's avatar yann300

add private _exist function to browser-files.js

parent ccdc138b
...@@ -9,11 +9,15 @@ function Files (storage) { ...@@ -9,11 +9,15 @@ function Files (storage) {
this.type = 'browser' this.type = 'browser'
this.exists = function (path, cb) { this.exists = function (path, cb) {
cb(null, this._exists(path))
}
this._exists = function (path) {
var unprefixedpath = this.removePrefix(path) var unprefixedpath = this.removePrefix(path)
// NOTE: ignore the config file // 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) { this.init = function (cb) {
...@@ -75,7 +79,7 @@ function Files (storage) { ...@@ -75,7 +79,7 @@ function Files (storage) {
this.remove = function (path) { this.remove = function (path) {
var unprefixedpath = this.removePrefix(path) var unprefixedpath = this.removePrefix(path)
if (!this.exists(unprefixedpath)) { if (!this._exists(unprefixedpath)) {
return false return false
} }
...@@ -133,7 +137,7 @@ function Files (storage) { ...@@ -133,7 +137,7 @@ function Files (storage) {
} }
// rename .browser-solidity.json to .remix.config // 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') this.rename('.browser-solidity.json', '.remix.config')
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment