ch.vorburger.exec
ch.vorburger.exec copied to clipboard
Java library to launch external processes
Michael, with the exec package, it seems to hang when the program to run is not found. Debugger shows that the IOexception was not caught and things kept moving forward...
Here's the issue that we're seeing: ``` ManagedProcess process = builder.build(); process.start(); process.waitForExit(); // Crashes the error below: ``` `waitForExit` fails with this: ``` Caused by: ch.vorburger.exec.ManagedProcessException: Asked to waitFor...
The `waitForExit()` methods currently internally (all?) use `checkResult()`. This makes it impossible to wait for a non-sucessful exit - which could be handy for some use cases (e.g. a CLI...
The `wait(100)` in `ch.vorburger.exec.ManagedProcess.startExecute()` isn't great. Wouldn't some sort of `yield()` (:question:) suffice?
When using this library somewhere where there already is a "command line" (as in an executable + arguments), then the `ManagedProcessBuilder` as-is currently is more in the way than helpful,...
`ManagedProcess` ideally should have something like a `startWaitGetOutput()` which would: ``` java p.start(); if (p.waitForExit() != 0) { throw fail(p.getProcLongName() + " did not return 0"); } return p.getConsole(); ```...
There ideally should be a `setConsoleBufferMaxLinesUnlimitedMemory()` kind of method to create "unlimited" output buffering.
For a new personal project I'm toying with, I'd actually prefer it now if this great old library of mine would separate its core functionality from the currently built-in and...
A testing mock or other suggestions for adding UT's would be useful. Possibly adding an exec mock that could allow simulating a test program and returning different error codes and...
Bumps org.apache.commons:commons-exec from 1.3 to 1.4.0. [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a...