diff --git a/apps/remix-ide/src/app/files/fileProvider.js b/apps/remix-ide/src/app/files/fileProvider.js index 3a2e85abd8..20a7135c12 100644 --- a/apps/remix-ide/src/app/files/fileProvider.js +++ b/apps/remix-ide/src/app/files/fileProvider.js @@ -200,7 +200,7 @@ class FileProvider { * @param {string} path is the folder to be copied over * @param {Function} visitFile is a function called for each visited files */ - _copyFolderToJsonInternal (path, visitFile) { + _copyFolderToJsonInternal (path, visitFile) { visitFile = visitFile || (() => {}) return new Promise((resolve, reject) => { const json = {} diff --git a/apps/remix-ide/src/app/files/workspaceFileProvider.js b/apps/remix-ide/src/app/files/workspaceFileProvider.js index cc7368e0e2..2b1a795d0b 100644 --- a/apps/remix-ide/src/app/files/workspaceFileProvider.js +++ b/apps/remix-ide/src/app/files/workspaceFileProvider.js @@ -50,10 +50,10 @@ class WorkspaceFileProvider extends FileProvider { async copyFolderToJson (directory, visitFile) { visitFile = visitFile || (() => {}) - const regex = new RegExp(`.workspaces/${this.workspace}/`, 'g'); + const regex = new RegExp(`.workspaces/${this.workspace}/`, 'g') let json = await super._copyFolderToJsonInternal(directory, ({ path, content }) => { visitFile({ path: path.replace(regex, ''), content }) - }) + }) json = JSON.stringify(json).replace(regex, '') return JSON.parse(json) }