forge-remote 0.1.10 → 0.1.11
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/package.json +1 -1
- package/src/init.js +15 -5
package/package.json
CHANGED
package/src/init.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright (c) 2025-2026 Iron Forge Apps
|
|
3
3
|
// Created by Daniel Wendel, CEO/Founder of Iron Forge Apps
|
|
4
4
|
|
|
5
|
-
import { execSync, execFileSync } from "child_process";
|
|
5
|
+
import { execSync, execFileSync, spawn } from "child_process";
|
|
6
6
|
import { createInterface } from "readline";
|
|
7
7
|
import { hostname, platform, homedir } from "os";
|
|
8
8
|
import { existsSync, mkdirSync, writeFileSync, readFileSync, rmSync } from "fs";
|
|
@@ -119,14 +119,24 @@ function waitForEnter(message) {
|
|
|
119
119
|
|
|
120
120
|
/**
|
|
121
121
|
* Open a URL in the default browser (best-effort, no throw).
|
|
122
|
+
* Uses spawn + detach to avoid blocking or suspending the terminal.
|
|
122
123
|
*/
|
|
123
124
|
function openBrowser(url) {
|
|
124
125
|
const p = platform();
|
|
125
126
|
try {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
let cmd, args;
|
|
128
|
+
if (p === "darwin") {
|
|
129
|
+
cmd = "open";
|
|
130
|
+
args = [url];
|
|
131
|
+
} else if (p === "win32") {
|
|
132
|
+
cmd = "cmd";
|
|
133
|
+
args = ["/c", "start", "", url];
|
|
134
|
+
} else {
|
|
135
|
+
cmd = "xdg-open";
|
|
136
|
+
args = [url];
|
|
137
|
+
}
|
|
138
|
+
const child = spawn(cmd, args, { detached: true, stdio: "ignore" });
|
|
139
|
+
child.unref();
|
|
130
140
|
} catch {
|
|
131
141
|
// Silently fail — URL is always printed for manual opening.
|
|
132
142
|
}
|