bitfab-cli 0.2.119 → 0.2.121
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 +22 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9711,11 +9711,15 @@ function spawnDetached(command, args) {
|
|
|
9711
9711
|
if (process.env.VITEST || process.env.NODE_ENV === "test") {
|
|
9712
9712
|
throw new Error("spawnDetached called in a test environment without being mocked");
|
|
9713
9713
|
}
|
|
9714
|
-
|
|
9715
|
-
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
|
|
9714
|
+
try {
|
|
9715
|
+
const child = spawn(command, [...args], { detached: true, stdio: "ignore" });
|
|
9716
|
+
child.on("error", () => {
|
|
9717
|
+
});
|
|
9718
|
+
child.unref();
|
|
9719
|
+
return child.pid ?? null;
|
|
9720
|
+
} catch {
|
|
9721
|
+
return null;
|
|
9722
|
+
}
|
|
9719
9723
|
}
|
|
9720
9724
|
function openChromiumApp(binaryPath, url2, sizeArgs) {
|
|
9721
9725
|
return spawnDetached(binaryPath, [`--app=${url2}`, ...sizeArgs]);
|
|
@@ -9730,17 +9734,8 @@ function openOsDefault(url2) {
|
|
|
9730
9734
|
}
|
|
9731
9735
|
return spawnDetached("xdg-open", [url2]);
|
|
9732
9736
|
}
|
|
9733
|
-
function isCodexOnMacos() {
|
|
9734
|
-
if (process.platform !== "darwin") {
|
|
9735
|
-
return false;
|
|
9736
|
-
}
|
|
9737
|
-
return process.env.CODEX_SANDBOX === "seatbelt" || process.env.CODEX_CI === "1" || process.env.CODEX_THREAD_ID != null;
|
|
9738
|
-
}
|
|
9739
9737
|
function shouldDisableChromelessWindows() {
|
|
9740
|
-
|
|
9741
|
-
return true;
|
|
9742
|
-
}
|
|
9743
|
-
return isCodexOnMacos();
|
|
9738
|
+
return process.env.BITFAB_DISABLE_CHROME_APP_WINDOWS === "1";
|
|
9744
9739
|
}
|
|
9745
9740
|
var WINDOW_OPEN_RATE_WINDOW_MS = 3e4;
|
|
9746
9741
|
var WINDOW_OPEN_RATE_LIMIT = 3;
|
|
@@ -9810,7 +9805,12 @@ function openChromelessWindow(url2) {
|
|
|
9810
9805
|
if (defaultChromium) {
|
|
9811
9806
|
const binary = findExistingBinary(defaultChromium.binaryPaths);
|
|
9812
9807
|
if (binary) {
|
|
9813
|
-
|
|
9808
|
+
const pid = openChromiumApp(binary, url2, sizeArgs);
|
|
9809
|
+
if (pid !== null) {
|
|
9810
|
+
return pid;
|
|
9811
|
+
}
|
|
9812
|
+
openOsDefault(url2);
|
|
9813
|
+
return null;
|
|
9814
9814
|
}
|
|
9815
9815
|
}
|
|
9816
9816
|
if (defaultId !== null && defaultChromium === null) {
|
|
@@ -9820,7 +9820,12 @@ function openChromelessWindow(url2) {
|
|
|
9820
9820
|
for (const browser of browsers) {
|
|
9821
9821
|
const binary = findExistingBinary(browser.binaryPaths);
|
|
9822
9822
|
if (binary) {
|
|
9823
|
-
|
|
9823
|
+
const pid = openChromiumApp(binary, url2, sizeArgs);
|
|
9824
|
+
if (pid !== null) {
|
|
9825
|
+
return pid;
|
|
9826
|
+
}
|
|
9827
|
+
openOsDefault(url2);
|
|
9828
|
+
return null;
|
|
9824
9829
|
}
|
|
9825
9830
|
}
|
|
9826
9831
|
openOsDefault(url2);
|