feat: SodiumPet 小钠桌宠 v0.1.0(Live2D 桌宠 / 经济任务 / 音乐 / 成就 / 编辑器 / MOD)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { spawn } from 'node:child_process'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import path from 'node:path'
|
||||
|
||||
const root = path.dirname(path.dirname(fileURLToPath(import.meta.url)))
|
||||
const npx = process.platform === 'win32' ? 'npx.cmd' : 'npx'
|
||||
|
||||
const vite = spawn(npx, ['vite', '--port', '5273'], { cwd: root, stdio: 'inherit' })
|
||||
|
||||
setTimeout(() => {
|
||||
const env = { ...process.env, VITE_DEV_SERVER_URL: 'http://localhost:5273' }
|
||||
const electron = spawn(npx, ['electron', '.'], { cwd: root, stdio: 'inherit', env })
|
||||
electron.on('exit', (code) => {
|
||||
vite.kill()
|
||||
process.exit(code ?? 0)
|
||||
})
|
||||
}, 1500)
|
||||
|
||||
vite.on('exit', (code) => process.exit(code ?? 0))
|
||||
Reference in New Issue
Block a user