Cannot get output from exec.exec or exec.getExecOutput
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
When executing a command using exec.exec or exec.getExecOutput, I cannot get the output of the command. I can see the command output in live web console, but when printing the output (constructed through listeners.stdout), it's empty. Similarly, the getExecOutput helper function also returns empty output.
async function configure () {
// Get configurations
const config = await getConfig()
const keyFile = 'private.key'
await fs.promises.writeFile(keyFile, config.gitUserSigningKey)
const { stdout } = await exec.getExecOutput('gpg', ['--import', keyFile])
// stdout is empty!
}
async function configure () {
// Get configurations
const config = await getConfig()
let cmdOutput = ''
const options = {
listeners: {
stdout: (data) => { cmdOutput += data.toString() }
}
}
const keyFile = 'private.key'
await fs.promises.writeFile(keyFile, config.gitUserSigningKey)
await exec.exec('gpg', ['--import', keyFile], options)
// stdout is empty!
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue through exec.exec and exec.getExecOutput with the gpg command shown, comparing the live console output with listeners.stdout and the returned stdout. Trace how command output is captured and returned; done means both APIs expose the command's stdout consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100