@@ -11,7 +11,7 @@ import {
11
11
Task ,
12
12
} from './types.ts'
13
13
import { REGISTRY_ADDRESS , startRegistry } from './registry.ts'
14
- import { detect , AGENTS , getCommand } from '@antfu/ni'
14
+ import { detect , AGENTS , getCommand , serializeCommand } from '@antfu/ni'
15
15
import actionsCore from '@actions/core'
16
16
17
17
const isGitHubActions = ! ! process . env . GITHUB_ACTIONS
@@ -194,7 +194,7 @@ function toCommand(
194
194
} else if ( typeof task === 'string' ) {
195
195
if ( scripts [ task ] != null ) {
196
196
const runTaskWithAgent = getCommand ( agent , 'run' , [ task ] )
197
- await $ `${ runTaskWithAgent } `
197
+ await $ `${ serializeCommand ( runTaskWithAgent ) } `
198
198
} else {
199
199
await $ `${ task } `
200
200
}
@@ -206,7 +206,7 @@ function toCommand(
206
206
task . script ,
207
207
...( task . args ?? [ ] ) ,
208
208
] )
209
- await $ `${ runTaskWithAgent } `
209
+ await $ `${ serializeCommand ( runTaskWithAgent ) } `
210
210
} else {
211
211
throw new Error (
212
212
`invalid task, script "${ task . script } " does not exist in package.json` ,
@@ -264,11 +264,9 @@ export async function runInRepo(options: RunOptions & RepoOptions) {
264
264
}
265
265
options . agent = detectedAgent
266
266
}
267
- if ( ! AGENTS [ options . agent ] ) {
267
+ if ( ! AGENTS . includes ( options . agent ) ) {
268
268
throw new Error (
269
- `Invalid agent ${ options . agent } . Allowed values: ${ Object . keys (
270
- AGENTS ,
271
- ) . join ( ', ' ) } `,
269
+ `Invalid agent ${ options . agent } . Allowed values: ${ AGENTS . join ( ', ' ) } ` ,
272
270
)
273
271
}
274
272
@@ -324,7 +322,7 @@ export async function runInRepo(options: RunOptions & RepoOptions) {
324
322
325
323
if ( verify && test ) {
326
324
const frozenInstall = getCommand ( agent , 'frozen' )
327
- await $ `${ frozenInstall } `
325
+ await $ `${ serializeCommand ( frozenInstall ) } `
328
326
await beforeBuildCommand ?.( pkg . scripts )
329
327
await buildCommand ?.( pkg . scripts )
330
328
await beforeTestCommand ?.( pkg . scripts )
@@ -431,12 +429,12 @@ export async function buildVue({ verify = false, publish = false }) {
431
429
const runTest = getCommand ( 'pnpm' , 'run' , [ 'test' ] )
432
430
433
431
// Prefix with `corepack` because pnpm 7 & 8's lockfile formats differ
434
- await $ `corepack ${ install } `
435
- await $ `${ runBuild } `
436
- await $ `${ runBuildDts } `
432
+ await $ `corepack ${ serializeCommand ( install ) } `
433
+ await $ `${ serializeCommand ( runBuild ) } `
434
+ await $ `${ serializeCommand ( runBuildDts ) } `
437
435
438
436
if ( verify ) {
439
- await $ `${ runTest } `
437
+ await $ `${ serializeCommand ( runTest ) } `
440
438
}
441
439
442
440
console . log ( )
0 commit comments