castle-web-cli 0.4.6 → 0.4.7
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/init.js +6 -1
- package/package.json +1 -1
package/dist/init.js
CHANGED
|
@@ -224,7 +224,12 @@ export async function init(dir, opts = {}) {
|
|
|
224
224
|
// handles the background spawn internally; init doesn't shell out.
|
|
225
225
|
// Bind all interfaces by default so a tailnet / LAN browser can reach
|
|
226
226
|
// the served page; users can override host on a subsequent serve call.
|
|
227
|
-
|
|
227
|
+
// Open in the user's default browser unless we're clearly headless (SSH
|
|
228
|
+
// session) or the user has opted out via CASTLE_WEB_CLI_NO_OPEN=1.
|
|
229
|
+
const noOpen = process.env.CASTLE_WEB_CLI_NO_OPEN === '1' ||
|
|
230
|
+
!!process.env.SSH_CONNECTION ||
|
|
231
|
+
!!process.env.SSH_TTY;
|
|
232
|
+
await serve(projectDir, { host: '0.0.0.0', detach: true, open: !noOpen });
|
|
228
233
|
return;
|
|
229
234
|
}
|
|
230
235
|
console.log('');
|