|
|
@ -196,11 +196,11 @@ class FileProvider { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* copy the folder recursively |
|
|
|
* copy the folder recursively (internal use) |
|
|
|
* @param {string} path is the folder to be copied over |
|
|
|
* @param {string} path is the folder to be copied over |
|
|
|
* @param {string} destination is the destination folder |
|
|
|
* @param {string} destination is the destination folder |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
copyFolderToJson (path) { |
|
|
|
_copyFolderToJsonInternal (path) { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
const json = {} |
|
|
|
const json = {} |
|
|
|
path = this.removePrefix(path) |
|
|
|
path = this.removePrefix(path) |
|
|
@ -212,7 +212,7 @@ class FileProvider { |
|
|
|
const file = {} |
|
|
|
const file = {} |
|
|
|
const curPath = `${path}${path.endsWith('/') ? '' : '/'}${item}` |
|
|
|
const curPath = `${path}${path.endsWith('/') ? '' : '/'}${item}` |
|
|
|
if (window.remixFileSystem.statSync(curPath).isDirectory()) { |
|
|
|
if (window.remixFileSystem.statSync(curPath).isDirectory()) { |
|
|
|
file.children = await this.copyFolderToJson(curPath) |
|
|
|
file.children = await this._copyFolderToJsonInternal(curPath) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
file.content = window.remixFileSystem.readFileSync(curPath, 'utf8') |
|
|
|
file.content = window.remixFileSystem.readFileSync(curPath, 'utf8') |
|
|
|
} |
|
|
|
} |
|
|
@ -228,6 +228,15 @@ class FileProvider { |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* copy the folder recursively |
|
|
|
|
|
|
|
* @param {string} path is the folder to be copied over |
|
|
|
|
|
|
|
* @param {string} destination is the destination folder |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
copyFolderToJson (path) { |
|
|
|
|
|
|
|
return this._copyFolderToJsonInternal(path) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
removeFile (path) { |
|
|
|
removeFile (path) { |
|
|
|
path = this.removePrefix(path) |
|
|
|
path = this.removePrefix(path) |
|
|
|
if (window.remixFileSystem.existsSync(path) && !window.remixFileSystem.statSync(path).isDirectory()) { |
|
|
|
if (window.remixFileSystem.existsSync(path) && !window.remixFileSystem.statSync(path).isDirectory()) { |
|
|
|