Skip to content
This repository was archived by the owner on Apr 19, 2025. It is now read-only.

Commit 973bb45

Browse files
committed
refactor(extension): only update storagePath for windows
Hopefully other OS's just work tm.
1 parent 9dd96cd commit 973bb45

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/extension.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import setPlugin from "./setPlugin";
33
import setLibrary from "./setLibrary";
44
import setNativeLibrary from "./setNativeLibrary";
55
import * as path from "path";
6-
import { platform } from "os";
76

87
export const id = "overextended.cfxlua-vscode";
98
export const extension = extensions.getExtension(id)!;
@@ -17,14 +16,13 @@ export async function activate(context: ExtensionContext) {
1716
const sourceUri = Uri.joinPath(extension.extensionUri, "plugin");
1817
const targetUri = Uri.joinPath(storageUri, "cfxlua");
1918
storagePath = targetUri.toString();
20-
// istg they go out of their way to make referencing the global storage path annoying
21-
storagePath = path.join(
22-
"~",
23-
platform() === "win32" ? "AppData\\Roaming" : ".config",
24-
storagePath.substring(storagePath.indexOf("Code")),
25-
);
2619

27-
console.log("storagePath", storagePath);
20+
if (storagePath.includes("AppData")) {
21+
storagePath = path.join(
22+
"~",
23+
storagePath.substring(storagePath.indexOf("AppData")),
24+
);
25+
}
2826

2927
try {
3028
await workspace.fs.stat(targetUri);

0 commit comments

Comments
 (0)