mirror of
https://github.com/HeyPuter/puter.git
synced 2025-02-03 07:48:46 +08:00
fix: automatically open browser when starting only if in dev env
This commit is contained in:
parent
70096a8d6f
commit
f500fb4706
@ -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`;
|
||||||
|
Loading…
Reference in New Issue
Block a user