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

os.outputof: add a second argument to select which stream to output #1589

Merged

Conversation

noresources
Copy link
Contributor

local o, e = os.outputof(cmd, streams)

Where streams could be one of
- "output" Only return standard output stream content
- "error" Only return standard error stream content
- "both" (default) Return both streams content

How does this PR change Premake's behavior?
Allow to filter standard output or error stream content from os.outputof() return value.
Ignoring error output is important when the invoked command may return an exit code 0 (success) but output some content on the error stream which will pollute the text result.

Are there any breaking changes? Will any existing behavior change?
The default behavior follow the previous one (report both streams)

  • Focus on a single fix or feature; remove any unrelated formatting or code changes
  • Add unit tests showing fix or feature works; all tests pass
  • Mention any related issues (put closes #XXXX in comment to auto-close issue when PR is merged)
  • Follow our coding conventions
  • Minimize the number of commits

    local o, e = os.outputof(cmd, streams)

    Where streams could be one of
    - "output" Only return standard output stream content
    - "error" Only return standard error stream content
    - "both" (default) Return both streams content
src/base/os.lua Outdated Show resolved Hide resolved
src/base/os.lua Outdated Show resolved Hide resolved
tests/base/test_os.lua Show resolved Hide resolved
noresources and others added 2 commits March 7, 2021 16:02
Co-authored-by: Samuel Surtees <11887457+samsinsane@users.noreply.github.com>
@samsinsane samsinsane merged commit 750f140 into premake:master Mar 10, 2021
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