MCPcopy Create free account
hub / github.com/Botloader/botloader / checkFolder

Method checkFolder

botloader-vscode/src/workspacemanager.ts:42–56  ·  view source on GitHub ↗
(folder: vscode.Uri)

Source from the content-addressed store, hash-verified

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);

Callers 2

constructorMethod · 0.95

Calls 1

subscribeGuildMethod · 0.45

Tested by

no test coverage detected