line-fido2-server icon indicating copy to clipboard operation
line-fido2-server copied to clipboard

Add a substitute function for execution on Windows OS

Open woohyun-jeong opened this issue 10 months ago • 1 comments
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 window_error

After taking action, it now appears as follows:Completed window_success

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");
    }

woohyun-jeong avatar Jan 15 '25 05:01 woohyun-jeong