olly-molly 0.1.9 ā 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/bin/cli.js +11 -0
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -123,6 +123,17 @@ async function main() {
|
|
|
123
123
|
|
|
124
124
|
console.log('\nš http://localhost:1234\n');
|
|
125
125
|
|
|
126
|
+
// Auto-open browser after a short delay
|
|
127
|
+
setTimeout(() => {
|
|
128
|
+
const url = 'http://localhost:1234';
|
|
129
|
+
const cmd = process.platform === 'darwin' ? 'open'
|
|
130
|
+
: process.platform === 'win32' ? 'start'
|
|
131
|
+
: 'xdg-open';
|
|
132
|
+
try {
|
|
133
|
+
execSync(`${cmd} ${url}`, { stdio: 'ignore' });
|
|
134
|
+
} catch {}
|
|
135
|
+
}, 2000);
|
|
136
|
+
|
|
126
137
|
const server = spawn('npx', ['next', 'start', '--port', '1234'], {
|
|
127
138
|
cwd: APP_DIR, stdio: 'inherit'
|
|
128
139
|
});
|