adhdev 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +23 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -753,18 +753,32 @@ async function loginFlow() {
|
|
|
753
753
|
}
|
|
754
754
|
async function injectTokenToIDE(ide, connectionToken) {
|
|
755
755
|
if (!ide.cliCommand) return;
|
|
756
|
-
const { execSync: execSync3 } = await import("child_process");
|
|
757
756
|
try {
|
|
758
|
-
const
|
|
759
|
-
vscode: `${(await import("os")).homedir()}/Library/Application Support/Code/User/settings.json`,
|
|
760
|
-
cursor: `${(await import("os")).homedir()}/Library/Application Support/Cursor/User/settings.json`,
|
|
761
|
-
antigravity: `${(await import("os")).homedir()}/Library/Application Support/Antigravity/User/settings.json`,
|
|
762
|
-
windsurf: `${(await import("os")).homedir()}/Library/Application Support/Windsurf/User/settings.json`
|
|
763
|
-
};
|
|
764
|
-
const settingsPath = settingsMap[ide.id];
|
|
765
|
-
if (!settingsPath) return;
|
|
757
|
+
const os = await import("os");
|
|
766
758
|
const fs = await import("fs");
|
|
767
759
|
const path = await import("path");
|
|
760
|
+
const platform2 = os.platform();
|
|
761
|
+
const home = os.homedir();
|
|
762
|
+
const getSettingsPath = (appName2) => {
|
|
763
|
+
if (platform2 === "darwin") {
|
|
764
|
+
return path.join(home, "Library", "Application Support", appName2, "User", "settings.json");
|
|
765
|
+
} else if (platform2 === "win32") {
|
|
766
|
+
return path.join(process.env.APPDATA || path.join(home, "AppData", "Roaming"), appName2, "User", "settings.json");
|
|
767
|
+
} else {
|
|
768
|
+
return path.join(home, ".config", appName2, "User", "settings.json");
|
|
769
|
+
}
|
|
770
|
+
};
|
|
771
|
+
const appNameMap = {
|
|
772
|
+
vscode: "Code",
|
|
773
|
+
cursor: "Cursor",
|
|
774
|
+
antigravity: "Antigravity",
|
|
775
|
+
windsurf: "Windsurf",
|
|
776
|
+
"vscode-insiders": "Code - Insiders",
|
|
777
|
+
vscodium: "VSCodium"
|
|
778
|
+
};
|
|
779
|
+
const appName = appNameMap[ide.id];
|
|
780
|
+
if (!appName) return;
|
|
781
|
+
const settingsPath = getSettingsPath(appName);
|
|
768
782
|
let settings = {};
|
|
769
783
|
if (fs.existsSync(settingsPath)) {
|
|
770
784
|
try {
|