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

Ensure standard in is always redirected when there is input #71

Merged
merged 2 commits into from
May 24, 2024

Conversation

AP-Hunt
Copy link

@AP-Hunt AP-Hunt commented May 20, 2024

Fixes #70

Previously standard in was only being opened when there were argument or environment variables. If there was a value in the "Input" parameter, but no arguments or environment variables, an exception was thrown about standard input not being redirected. This made it impossible to write code like below to pipe data to a program on stdin.

cli {
  Exec "cat"
  Input "foo"
}

The first commit on the branch increases test coverage for Linux and Mac OS X by creating separate sets of tests for them, and uses NUnit's Platform attribute to ensure only the relevant tests are run on a given OS.

I would be happy to drop the first commit if that's not something you want.

Andy Hunt added 2 commits May 20, 2024 23:26
Increases test coverage by introducing dedicated Windows and
Linux/Unix/MacOs test suites. Uses the NUnit "Platform" attribute to
ensure only the relevant tests are run on a given OS.

The unit tests are run across all 3 OS' in the GitHub Actions workflow,
so every test will get run, even if code authors don't have access to
one of the OS'.
Previously standard in was only being opened when there were argument
or environment variables. If there was a value in the "Input" parameter,
but no arguments or environment variables, an exception was thrown about
stanard input not being redirected. This made it impossible to write
code like

cli {
  Exec "cat"
  Input "foo"
}

To pipe data to a program on stdin.
@CaptnCodr
Copy link
Owner

CaptnCodr commented May 21, 2024

Hi @AP-Hunt,
thank you for your issue and resolving PR.

The first commit on the branch increases test coverage for Linux and Mac OS X by creating separate sets of tests for them, and uses NUnit's Platform attribute to ensure only the relevant tests are run on a given OS.

I didn't even know, that this attribute exist, so I think it's an improvement.

I'll create a new release in the next days, I hope it's ok?! 🙂

@AP-Hunt
Copy link
Author

AP-Hunt commented May 22, 2024

Yeah not a problem at all. No rush from me.

@CaptnCodr CaptnCodr merged commit 6e726e3 into CaptnCodr:main May 24, 2024
3 checks passed
@CaptnCodr
Copy link
Owner

This fix has been released in Fli v1.111.1 and is already available at Nuget.

Thank you, appreciate your work! 🙂

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.

Cannot pass data on stdin to a program with Exec
2 participants