|
|
@ -84,6 +84,8 @@ class FileProvider { |
|
|
|
cb = cb || function () {} |
|
|
|
cb = cb || function () {} |
|
|
|
var unprefixedpath = this.removePrefix(path) |
|
|
|
var unprefixedpath = this.removePrefix(path) |
|
|
|
var exists = window.remixFileSystem.existsSync(unprefixedpath) |
|
|
|
var exists = window.remixFileSystem.existsSync(unprefixedpath) |
|
|
|
|
|
|
|
if (exists && window.remixFileSystem.readFileSync(unprefixedpath, 'utf8') === content) return true |
|
|
|
|
|
|
|
|
|
|
|
if (!exists && unprefixedpath.indexOf('/') !== -1) { |
|
|
|
if (!exists && unprefixedpath.indexOf('/') !== -1) { |
|
|
|
const paths = unprefixedpath.split('/') |
|
|
|
const paths = unprefixedpath.split('/') |
|
|
|
paths.pop() // last element should the filename
|
|
|
|
paths.pop() // last element should the filename
|
|
|
@ -98,7 +100,6 @@ class FileProvider { |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
try { |
|
|
|
try { |
|
|
|
if (window.remixFileSystem.readFileSync(unprefixedpath, 'utf8') === content) return true |
|
|
|
|
|
|
|
window.remixFileSystem.writeFileSync(unprefixedpath, content) |
|
|
|
window.remixFileSystem.writeFileSync(unprefixedpath, content) |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
cb(e) |
|
|
|
cb(e) |
|
|
|