oh-my-opencode 0.1.21 → 0.1.23
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 +16 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15260,7 +15260,7 @@ var lsp_code_action_resolve = tool({
|
|
|
15260
15260
|
// src/tools/ast-grep/constants.ts
|
|
15261
15261
|
import { createRequire as createRequire4 } from "module";
|
|
15262
15262
|
import { dirname as dirname2, join as join5 } from "path";
|
|
15263
|
-
import { existsSync as existsSync7 } from "fs";
|
|
15263
|
+
import { existsSync as existsSync7, statSync } from "fs";
|
|
15264
15264
|
|
|
15265
15265
|
// src/tools/ast-grep/downloader.ts
|
|
15266
15266
|
var {spawn: spawn4 } = globalThis.Bun;
|
|
@@ -15372,6 +15372,13 @@ async function ensureAstGrepBinary() {
|
|
|
15372
15372
|
}
|
|
15373
15373
|
|
|
15374
15374
|
// src/tools/ast-grep/constants.ts
|
|
15375
|
+
function isValidBinary(filePath) {
|
|
15376
|
+
try {
|
|
15377
|
+
return statSync(filePath).size > 1e4;
|
|
15378
|
+
} catch {
|
|
15379
|
+
return false;
|
|
15380
|
+
}
|
|
15381
|
+
}
|
|
15375
15382
|
function getPlatformPackageName2() {
|
|
15376
15383
|
const platform = process.platform;
|
|
15377
15384
|
const arch = process.arch;
|
|
@@ -15386,24 +15393,8 @@ function getPlatformPackageName2() {
|
|
|
15386
15393
|
};
|
|
15387
15394
|
return platformMap[`${platform}-${arch}`] ?? null;
|
|
15388
15395
|
}
|
|
15389
|
-
function isValidBinary(filePath) {
|
|
15390
|
-
try {
|
|
15391
|
-
const stats = __require("fs").statSync(filePath);
|
|
15392
|
-
return stats.size > 1e4;
|
|
15393
|
-
} catch {
|
|
15394
|
-
return false;
|
|
15395
|
-
}
|
|
15396
|
-
}
|
|
15397
15396
|
function findSgCliPathSync() {
|
|
15398
15397
|
const binaryName = process.platform === "win32" ? "sg.exe" : "sg";
|
|
15399
|
-
if (process.platform === "darwin") {
|
|
15400
|
-
const homebrewPaths = ["/opt/homebrew/bin/sg", "/usr/local/bin/sg"];
|
|
15401
|
-
for (const path of homebrewPaths) {
|
|
15402
|
-
if (existsSync7(path) && isValidBinary(path)) {
|
|
15403
|
-
return path;
|
|
15404
|
-
}
|
|
15405
|
-
}
|
|
15406
|
-
}
|
|
15407
15398
|
const cachedPath = getCachedBinaryPath2();
|
|
15408
15399
|
if (cachedPath && isValidBinary(cachedPath)) {
|
|
15409
15400
|
return cachedPath;
|
|
@@ -15430,6 +15421,14 @@ function findSgCliPathSync() {
|
|
|
15430
15421
|
}
|
|
15431
15422
|
} catch {}
|
|
15432
15423
|
}
|
|
15424
|
+
if (process.platform === "darwin") {
|
|
15425
|
+
const homebrewPaths = ["/opt/homebrew/bin/sg", "/usr/local/bin/sg"];
|
|
15426
|
+
for (const path of homebrewPaths) {
|
|
15427
|
+
if (existsSync7(path) && isValidBinary(path)) {
|
|
15428
|
+
return path;
|
|
15429
|
+
}
|
|
15430
|
+
}
|
|
15431
|
+
}
|
|
15433
15432
|
return null;
|
|
15434
15433
|
}
|
|
15435
15434
|
var resolvedCliPath2 = null;
|