fix: 修复dev/build/serve脚本无法在 Windows 平台正常执行

This commit is contained in:
Hooray
2026-04-01 12:21:24 +08:00
parent 8bef84cec2
commit 7cf493a6f8
3 changed files with 6 additions and 0 deletions
+2
View File
@@ -9,6 +9,7 @@ import * as p from '@clack/prompts'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const rootDir = path.resolve(__dirname, '..')
const isWindows = process.platform === 'win32'
let childProcess: ReturnType<typeof spawn> | null = null
@@ -59,6 +60,7 @@ async function runBuild(packageName: string, script: string): Promise<void> {
childProcess = spawn('pnpm', ['--filter', packageName, 'run', script], {
stdio: 'inherit',
cwd: rootDir,
shell: isWindows,
})
childProcess.on('close', (code) => {
+2
View File
@@ -9,6 +9,7 @@ import * as p from '@clack/prompts'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const rootDir = path.resolve(__dirname, '..')
const isWindows = process.platform === 'win32'
let childProcess: ReturnType<typeof spawn> | null = null
@@ -56,6 +57,7 @@ async function runDev(packageName: string): Promise<void> {
childProcess = spawn('pnpm', ['--filter', packageName, 'run', 'dev'], {
stdio: 'inherit',
cwd: rootDir,
shell: isWindows,
})
childProcess.on('close', (code) => {
+2
View File
@@ -9,6 +9,7 @@ import * as p from '@clack/prompts'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const rootDir = path.resolve(__dirname, '..')
const isWindows = process.platform === 'win32'
let childProcess: ReturnType<typeof spawn> | null = null
@@ -59,6 +60,7 @@ async function runServe(packageName: string, script: string): Promise<void> {
childProcess = spawn('pnpm', ['--filter', packageName, 'run', script], {
stdio: 'inherit',
cwd: rootDir,
shell: isWindows,
})
childProcess.on('close', (code) => {