fix(cli): intermittent dependency installation failure (#207)

This commit is contained in:
pengzhanbo 2024-09-23 04:02:08 +08:00 committed by GitHub
parent 2cf606b1de
commit 04f488e349
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -2,6 +2,7 @@ import type { PromptResult, ResolvedData } from './types.js'
import path from 'node:path'
import process from 'node:process'
import { intro, outro, spinner } from '@clack/prompts'
import { sleep } from '@pengzhanbo/utils'
import { execaCommand } from 'execa'
import colors from 'picocolors'
import { Mode } from './constants.js'
@ -21,6 +22,10 @@ export async function run(mode: Mode, root?: string) {
await generate(mode, data)
// Delay for some time, I/O may not be completed yet,
// executing subsequent tasks at this point may cause issues.
await sleep(200)
const cwd = path.join(process.cwd(), data.root)
if (data.git) {
progress.message(t('spinner.git'))

View File

@ -23,6 +23,7 @@ jobs:
{{#if (equal packageManager "pnpm")}}
- name: Setup pnpm
uses: pnpm/action-setup@v4
{{/if}}
- name: Setup Node.js
uses: actions/setup-node@v4