MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / getWindowsDisks

Function getWindowsDisks

daemon/src/service/file_router_service.ts:18–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16let cacheDisks: string[] = [];
17
18export function getWindowsDisks() {
19 if (os.platform() !== "win32") return [];
20 if (cacheDisks.length > 0) return cacheDisks;
21 const res: string[] = [];
22 // A - Z
23 for (let i = 65; i <= 90; i++) {
24 const letter = String.fromCharCode(i);
25 try {
26 if (fs.existsSync(`${letter}:\\`)) res.push(letter);
27 } catch (error) {
28 // ignore error
29 }
30 }
31 cacheDisks = res;
32 return res;
33}

Callers 1

file_router.tsFile · 0.90

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected