line-fido2-server
line-fido2-server copied to clipboard
Add a substitute function for execution on Windows OS
trafficstars
What is this PR for?
The executeGrepProcessWindowCommand function can be used as a replacement for the executeGrepProcessCommand function when running on Windows OS.
Overview or reasons
- Please explain the contents. Add a function for testing the server on Windows OS.
Tasks
- Please explain what did you do. Add executeGrepProcessWindowCommand function to EmbeddedRedisServerConfiguration class.
Result
- Please Describe the result Verify proper functionality on Windows OS with executeGrepProcessWindowCommand function.
The original error was as follows: Cannot run program "/bin/sh": CreateProcess error=2
After taking action, it now appears as follows:Completed
The code in the EmbeddedRedisServerConfiguration class needs to be modified when running on Windows OS.
private boolean isRedisRunning() throws IOException {
return isRunning(executeGrepProcessWindowCommand(redisPort));
}
public int findAvailablePort() throws IOException {
for (int port = 10000; port <= 65535; port++) {
Process process = executeGrepProcessWindowCommand(port);
if (!isRunning(process)) {
return port;
}
}
throw new IllegalArgumentException("Not Found Available port: 10000 ~ 65535");
}