Skip to content

Commit

Permalink
ci: fix dev script
Browse files Browse the repository at this point in the history
  • Loading branch information
FliPPeDround committed Jul 1, 2024
1 parent 8c2f305 commit 787e76d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/dev.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const process = require('node:process')

const workingDirectory = path.join(__dirname, '../../sample-project')

// 启动开发命令,改为使用 pipe 来捕获输出
// 启动开发命令,改为使用 pipe 来捕获错误输出
const devProcess = spawn('pnpm', ['dev:mp-weixin'], {
stdio: ['inherit', 'pipe', 'pipe'], // 只对 stdout 和 stderr 使用 pipe
stdio: ['inherit', 'inherit', 'pipe'],
shell: true,
cwd: workingDirectory,
})
Expand Down Expand Up @@ -42,6 +42,7 @@ async function main() {
const expectedFile = path.join(workingDirectory, 'dist/dev/mp-weixin/app.js')
await waitForFile(expectedFile)
devProcess.kill() // 结束进程
process.exit(0)
}

main().catch((err) => {
Expand Down

0 comments on commit 787e76d

Please sign in to comment.