File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
process/src/main/java/io/smallrye/common/process Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 11package io .smallrye .common .process ;
22
33import java .io .File ;
4+ import java .io .IOException ;
45import java .nio .charset .Charset ;
56import java .nio .charset .UnsupportedCharsetException ;
67import java .nio .file .Files ;
@@ -96,6 +97,14 @@ public static Optional<Path> pathOfCommand(Path path) {
9697 for (String ext : Windows .pathExt ) {
9798 Path execPathExt = execPath .getParent ().resolve (execPath .getFileName () + ext );
9899 if (Files .isExecutable (execPathExt )) {
100+ // This will ensure we get the case-sensitive real path.
101+ // e.g., C:\Program Files\Docker\Docker\resources\bin\docker.EXE becomes
102+ // C:\Program Files\Docker\Docker\resources\bin\docker.exe
103+ try {
104+ execPathExt = execPathExt .toRealPath ();
105+ } catch (IOException e ) {
106+ throw new RuntimeException (e );
107+ }
99108 return Optional .of (execPathExt );
100109 }
101110 }
You can’t perform that action at this time.
0 commit comments