Changed from user specific, to open for everyone
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { execSync } from "node:child_process"
|
||||
import { platform } from "node:os"
|
||||
|
||||
const url = process.argv[2] || "http://localhost:3001/splash"
|
||||
|
||||
const sleep = (ms) => new Promise((r) => setTimeout(r, ms))
|
||||
|
||||
async function main() {
|
||||
await sleep(8000)
|
||||
try {
|
||||
if (platform() === "win32") {
|
||||
execSync(`start "" "${url}"`, { stdio: "ignore", timeout: 5000 })
|
||||
} else if (platform() === "darwin") {
|
||||
execSync(`open "${url}"`, { stdio: "ignore", timeout: 5000 })
|
||||
} else {
|
||||
execSync(`xdg-open "${url}"`, { stdio: "ignore", timeout: 5000 })
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("Failed to open browser:", e.message)
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
||||
Reference in New Issue
Block a user