Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: always return stdout and stderr from execCmd #406

Merged
merged 5 commits into from
Feb 16, 2023
Merged

Conversation

peternhale
Copy link
Contributor

@W-12556866@

Found an instance where a plugin command finishes successfully, but needed results were capture on both stdout and stderr.

Modified execCmd to return both stdout and stderr regardless of command exit code.

@@ -167,14 +167,13 @@ const execCmdSync = <T>(cmd: string, options?: ExecCmdOptions): ExecCmdResult<T>
const startTime = process.hrtime();
const code = (shelljs.exec(`${cmd} 1> ${stdoutFile} 2> ${stderrFile} `, cmdOptions) as ShellString).code;

if (code === 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

request, while you're here. Up on 158, can those fileLocations point to options.cwd so that stuff gets put in the sessionDir (which gets cleaned) instead of in the top of the project? I've seen that a few times, where if you ctrl-c the nut early you have to clean up files, gitignore them, etc.

@peternhale peternhale merged commit ca970ab into main Feb 16, 2023
@peternhale peternhale deleted the phale/W-12556866 branch February 16, 2023 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants