Skip to content

Commit

Permalink
refactor: use built-in exec in script
Browse files Browse the repository at this point in the history
  • Loading branch information
iiroj committed May 11, 2024
1 parent 77292f6 commit 4260b6d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/list-dependency-node-versions.js
Expand Up @@ -3,7 +3,8 @@ import { dirname, join } from 'node:path'
import { fileURLToPath, pathToFileURL } from 'node:url'

import chalk from 'chalk'
import { execa } from 'execa'

import { exec } from '../lib/exec.js'

const __dirname = dirname(fileURLToPath(import.meta.url))

Expand All @@ -15,10 +16,9 @@ console.log(chalk.dim('Listing required Node.js versions for dependencies:'))
console.log(chalk.dim('---------------------------------------------------'))

for (const dependency of Object.keys(dependencies)) {
const { all } = await execa('npm', ['info', dependency, 'engines.node'], {
all: true,
const output = await exec('npm', ['info', dependency, 'engines.node'], {
cwd: __dirname,
})

console.log(`${chalk.greenBright(dependency)}:`, all || chalk.dim('-'))
console.log(`${chalk.greenBright(dependency)}:`, output || chalk.dim('-'))
}

0 comments on commit 4260b6d

Please sign in to comment.