adhdev 0.1.2 → 0.1.3
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 +21 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -150,12 +150,10 @@ function getIdeVersion(cliCommand) {
|
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
function checkPathExists(paths) {
|
|
153
|
-
const os = (0, import_os.platform)();
|
|
154
153
|
for (const p of paths) {
|
|
155
154
|
if (p.includes("*")) {
|
|
156
|
-
const
|
|
157
|
-
const
|
|
158
|
-
const resolved = parts.join(homeDir.split(/[/\\]/).pop() || "");
|
|
155
|
+
const home = (0, import_os.homedir)();
|
|
156
|
+
const resolved = p.replace(/^C:\\\\Users\\\\\*/, home.replace(/\//g, "\\"));
|
|
159
157
|
if ((0, import_fs.existsSync)(resolved)) return resolved;
|
|
160
158
|
} else {
|
|
161
159
|
if ((0, import_fs.existsSync)(p)) return p;
|
|
@@ -175,6 +173,24 @@ async function detectIDEs() {
|
|
|
175
173
|
const bundledCli = `${appPath}/Contents/Resources/app/bin/${def.cli}`;
|
|
176
174
|
if ((0, import_fs.existsSync)(bundledCli)) resolvedCli = bundledCli;
|
|
177
175
|
}
|
|
176
|
+
if (!resolvedCli && appPath && os === "win32") {
|
|
177
|
+
const { dirname } = await import("path");
|
|
178
|
+
const appDir = dirname(appPath);
|
|
179
|
+
const candidates = [
|
|
180
|
+
`${appDir}\\bin\\${def.cli}.cmd`,
|
|
181
|
+
`${appDir}\\bin\\${def.cli}`,
|
|
182
|
+
`${appDir}\\${def.cli}.cmd`,
|
|
183
|
+
`${appDir}\\${def.cli}.exe`,
|
|
184
|
+
// resources/app/bin 하위
|
|
185
|
+
`${appDir}\\resources\\app\\bin\\${def.cli}.cmd`
|
|
186
|
+
];
|
|
187
|
+
for (const c of candidates) {
|
|
188
|
+
if ((0, import_fs.existsSync)(c)) {
|
|
189
|
+
resolvedCli = c;
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
178
194
|
const version = resolvedCli ? getIdeVersion(resolvedCli) : null;
|
|
179
195
|
results.push({
|
|
180
196
|
id: def.id,
|
|
@@ -182,7 +198,7 @@ async function detectIDEs() {
|
|
|
182
198
|
displayName: def.displayName,
|
|
183
199
|
installed,
|
|
184
200
|
path: appPath || cliPath,
|
|
185
|
-
cliCommand: resolvedCli
|
|
201
|
+
cliCommand: resolvedCli || null,
|
|
186
202
|
version,
|
|
187
203
|
icon: def.icon,
|
|
188
204
|
extensionSupport: def.extensionSupport
|