From 2c0e911ef124394f96cc788a1848410bea9d7a8d Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 27 Sep 2019 11:14:16 +0200 Subject: [PATCH] check file content only if file exist --- src/app/files/fileProvider.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)