-
Notifications
You must be signed in to change notification settings - Fork 27
/
vscodeUninstall.mjs
37 lines (29 loc) · 1006 Bytes
/
vscodeUninstall.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* eslint-disable */
import { homedir } from "os";
import { join } from "path";
import { rimraf } from "rimraf";
function getVsCodeUserPath() {
const homeDir = homedir();
let folder;
switch (process.platform) {
case "win32":
folder = process.env.APPDATA || join(homeDir, "AppData", "Roaming");
break;
case "darwin":
folder = join(homeDir, "Library", "Application Support");
break;
case "linux":
folder = join(homeDir, ".config");
break;
default:
folder = "/var/local";
}
return join(folder, "Code", "User");
}
const stubsFolder = join(getVsCodeUserPath(), "Pico-W-Stub");
const newStubsFolder = join(homedir(), ".micropico-stubs")
const result = await rimraf(stubsFolder, { glob: false });
console.log("Pico-W-Stub uninstall result: ", result ? "success" : "failure");
const result2 = await rimraf(newStubsFolder, { glob: false });
console.log("New stubs uninstall result: ", result2 ? "success" : "failure");
/* eslint-enable */