fix: automatically open browser when starting only if in dev env

This commit is contained in:
jelveh 2024-11-22 07:11:05 -08:00
parent 70096a8d6f
commit f500fb4706

View File

@ -127,14 +127,16 @@ class WebServerService extends BaseService {
const url = config.origin; const url = config.origin;
// Open the browser to the URL // Open the browser to the URL of Puter
try{ // (if we are in development mode only)
const openModule = await import('open'); if(config.env === 'dev') {
openModule.default(url); try{
}catch(e){ const openModule = await import('open');
console.log('Error opening browser', e); openModule.default(url);
}catch(e){
console.log('Error opening browser', e);
}
} }
this.startup_widget = () => { this.startup_widget = () => {
const link = `\x1B[34;1m${osclink(url)}\x1B[0m`; const link = `\x1B[34;1m${osclink(url)}\x1B[0m`;