MCPcopy Create free account
hub / github.com/wonderwhy-er/DesktopCommanderMCP / createFileURL

Function createFileURL

src/npm-scripts/uninstall.ts:10–24  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

8
9// Helper function to properly convert file paths to URLs, especially for Windows
10function createFileURL(filePath: string): URL {
11 if (isWindows) {
12 // Ensure path uses forward slashes for URL format
13 const normalizedPath = filePath.replace(/\\/g, '/');
14 // Ensure path has proper file:// prefix
15 if (normalizedPath.startsWith('/')) {
16 return new URL(`file://${normalizedPath}`);
17 } else {
18 return new URL(`file:///${normalizedPath}`);
19 }
20 } else {
21 // For non-Windows, we can use the built-in function
22 return pathToFileURL(filePath);
23 }
24}
25
26export async function runUninstall() {
27 try {

Callers 1

runUninstallFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected