diff --git a/src/app/files/fileProvider.js b/src/app/files/fileProvider.js index fa315d5c17..6695a906f8 100644 --- a/src/app/files/fileProvider.js +++ b/src/app/files/fileProvider.js @@ -84,6 +84,8 @@ class FileProvider { cb = cb || function () {} var unprefixedpath = this.removePrefix(path) var exists = window.remixFileSystem.existsSync(unprefixedpath) + if (exists && window.remixFileSystem.readFileSync(unprefixedpath, 'utf8') === content) return true + if (!exists && unprefixedpath.indexOf('/') !== -1) { const paths = unprefixedpath.split('/') paths.pop() // last element should the filename @@ -98,7 +100,6 @@ class FileProvider { }) } try { - if (window.remixFileSystem.readFileSync(unprefixedpath, 'utf8') === content) return true window.remixFileSystem.writeFileSync(unprefixedpath, content) } catch (e) { cb(e)