diff --git a/ci.yml b/ci.yml index bb7b4f5..a566dfc 100644 --- a/ci.yml +++ b/ci.yml @@ -1,7 +1,5 @@ prepare: steps: - - name: Clean up - command: rm -rf .codesphere-internal/code .codesphere-internal/nohup-out .codesphere-internal/vscode_cli.tar.gz ../.vscode-server ../.vscode - name: Install Dependencies command: cd server && npm install - name: Change node version diff --git a/src/SidebarProvider.ts b/src/SidebarProvider.ts index bb94e98..c9f6f96 100644 --- a/src/SidebarProvider.ts +++ b/src/SidebarProvider.ts @@ -287,8 +287,22 @@ export class SidebarProvider implements vscode.WebviewViewProvider { let workspaceURL = stdout ? stdout.trim() : ``; if (workspaceURL === '57609-3000.2.codesphere.com') { - request(uaSocket, "terminalStream", { method: "data", data: ""}, "workspace-proxy", 4); - request(uaSocket, "terminalStream", { method: "data", data: "./.codesphere-internal/code tunnel --install-extension " + vsixFile + "\r"}, "workspace-proxy", 4); + let removeVSC = "rm -rf .codesphere-internal/nohup-out .codesphere-internal/vscode_cli.tar.gz ../.vscode-server ../.vscode"; + exec(removeVSC, (error, stdout, stderr) => { + if (error) { + console.error(`exec error: ${error}`); + return; + } + + if (stderr) { + console.error(`stderr: ${stderr}`); + return; + } + + console.log(`stdout: ${stdout}`); + request(uaSocket, "terminalStream", { method: "data", data: ""}, "workspace-proxy", 4); + request(uaSocket, "terminalStream", { method: "data", data: "./.codesphere-internal/code tunnel --install-extension " + vsixFile + "\r"}, "workspace-proxy", 4); + }); } else { request(uaSocket, "terminalStream", { method: "data", data: ""}, "workspace-proxy", 4); request(uaSocket, "terminalStream", { method: "data", data: "./.codesphere-internal/code tunnel --install-extension Codesphere.codesphere" +"\r"}, "workspace-proxy", 4);