(folder: vscode.Uri)
| 40 | } |
| 41 | |
| 42 | async checkFolder(folder: vscode.Uri) { |
| 43 | try { |
| 44 | // should throw an error if it dosen't exist |
| 45 | let indexFile = await vscode.workspace.fs.readFile(vscode.Uri.joinPath(folder, "/.botloader/index.json")); |
| 46 | let decoder = new TextDecoder("utf-8"); |
| 47 | let parsedIndex: IndexFile = JSON.parse(decoder.decode(indexFile)); |
| 48 | |
| 49 | this.ws.subscribeGuild(parsedIndex.guild.id); |
| 50 | |
| 51 | if (!this.openGuildWorkspaces.some(elem => elem.folder === folder)) { |
| 52 | this.openGuildWorkspaces.push(new GuildScriptWorkspace(folder, this.apiClient)); |
| 53 | } |
| 54 | this.outputChannel.show(true); |
| 55 | } catch { } |
| 56 | } |
| 57 | |
| 58 | async pushUri(uri: vscode.Uri) { |
| 59 | let folder = vscode.workspace.getWorkspaceFolder(uri); |
no test coverage detected