mirror of
https://github.com/fantastic-admin/basic.git
synced 2026-10-07 13:17:52 +08:00
fix: 修复dev/build/serve脚本无法在 Windows 平台正常执行
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user