|
|
@ -171,8 +171,20 @@ module.exports = class Filepanel extends ViewPlugin { |
|
|
|
if (error) console.error(error) |
|
|
|
if (error) console.error(error) |
|
|
|
if (Object.keys(filesList).length === 0) { |
|
|
|
if (Object.keys(filesList).length === 0) { |
|
|
|
await this.createWorkspace('default_workspace') |
|
|
|
await this.createWorkspace('default_workspace') |
|
|
|
|
|
|
|
resolve('default_workspace') |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this._deps.fileProviders.browser.resolveDirectory('.workspaces', async (error, filesList) => { |
|
|
|
|
|
|
|
if (error) console.error(error) |
|
|
|
|
|
|
|
if (Object.keys(filesList).length > 0) { |
|
|
|
|
|
|
|
const workspacePath = Object.keys(filesList)[0].split('/').filter(val => val) |
|
|
|
|
|
|
|
const workspaceName = workspacePath[workspacePath.length - 1] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this._deps.fileProviders.workspace.setWorkspace(workspaceName) |
|
|
|
|
|
|
|
resolve(workspaceName) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
reject(new Error('Can\'t find available workspace.')) |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
resolve(true) |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|