Skip to content

Commit

Permalink
chore: rename alias ezspawnAsync -> ezspawn
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Apr 25, 2024
1 parent bf603c5 commit 32d893d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/commands/check/checkGlobal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-console */
import { async as ezspawnAsync } from '@jsdevtools/ez-spawn'
import { async as ezspawn } from '@jsdevtools/ez-spawn'
import c from 'picocolors'
import prompts from 'prompts'
import { type Agent, getCommand } from '@antfu/ni'
Expand Down Expand Up @@ -118,7 +118,7 @@ async function loadGlobalPnpmPackage(options: CheckOptions): Promise<GlobalPacka
let pnpmStdout

try {
pnpmStdout = (await ezspawnAsync('pnpm', ['ls', '--global', '--depth=0', '--json'], { stdio: 'pipe' })).stdout
pnpmStdout = (await ezspawn('pnpm', ['ls', '--global', '--depth=0', '--json'], { stdio: 'pipe' })).stdout
}
catch (error) {
return []
Expand Down Expand Up @@ -152,7 +152,7 @@ async function loadGlobalPnpmPackage(options: CheckOptions): Promise<GlobalPacka
}

async function loadGlobalNpmPackage(options: CheckOptions): Promise<GlobalPackageMeta> {
const { stdout } = await ezspawnAsync('npm', ['ls', '--global', '--depth=0', '--json'], { stdio: 'pipe' })
const { stdout } = await ezspawn('npm', ['ls', '--global', '--depth=0', '--json'], { stdio: 'pipe' })
const npmOut = JSON.parse(stdout) as NpmOut
const filter = createDependenciesFilter(options.include, options.exclude)

Expand Down Expand Up @@ -182,5 +182,5 @@ async function installPkg(pkg: GlobalPackageMeta) {
const dependencies = dumpDependencies(changes, 'dependencies')
const updateArgs = Object.entries(dependencies).map(([name, version]) => `${name}@${version}`)
const installCommand = getCommand(pkg.agent, 'global', [...updateArgs])
await ezspawnAsync(installCommand, { stdio: 'inherit' })
await ezspawn(installCommand, { stdio: 'inherit' })
}
4 changes: 2 additions & 2 deletions test/cli.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import path from 'node:path'
import { expect, it } from 'vitest'
import { async as ezspawnAsync } from '@jsdevtools/ez-spawn'
import { async as ezspawn } from '@jsdevtools/ez-spawn'

it('taze cli should just works', async () => {
const binPath = path.resolve(__dirname, '../bin/taze.mjs')

const proc = await ezspawnAsync(process.execPath, [binPath], { stdio: 'pipe' })
const proc = await ezspawn(process.execPath, [binPath], { stdio: 'pipe' })

expect(proc.stderr).toBe('')
})

0 comments on commit 32d893d

Please sign in to comment.