Skip to content

Commit

Permalink
Use execa for command descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Oct 13, 2019
1 parent e821325 commit b5f5221
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/run/description.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import { execFile } from 'child_process'
import { promisify } from 'util'

const pExecFile = promisify(execFile)
import execa from 'execa'

// Runtime description for this runner, specified as `command.versions`
// Used by the `--info` option
Expand Down Expand Up @@ -33,8 +30,8 @@ const getVersion = async function({ name, value, runnerId }) {
const [file, ...args] = value

try {
const { stdout } = await pExecFile(file, args)
const version = stdout.trim().replace(LEADING_V, '')
const { stdout } = await execa(file, args, { preferLocal: true })
const version = stdout.replace(LEADING_V, '')
return `${nameA}${version}`
} catch (error) {
throw new Error(`Could not load runner '${runnerId}'\n\n${error.message}`)
Expand Down

0 comments on commit b5f5221

Please sign in to comment.