diff --git a/src/test/java/com/github/copilot/sdk/TestUtil.java b/src/test/java/com/github/copilot/sdk/TestUtil.java index d9462af87..60494e902 100644 --- a/src/test/java/com/github/copilot/sdk/TestUtil.java +++ b/src/test/java/com/github/copilot/sdk/TestUtil.java @@ -55,16 +55,16 @@ public static String tempPath(String filename) { * {@code null} if none was found */ static String findCliPath() { - String copilotInPath = findCopilotInPath(); - if (copilotInPath != null) { - return copilotInPath; - } - String envPath = System.getenv("COPILOT_CLI_PATH"); if (envPath != null && !envPath.isEmpty()) { return envPath; } + String copilotInPath = findCopilotInPath(); + if (copilotInPath != null) { + return copilotInPath; + } + Path current = Paths.get(System.getProperty("user.dir")); while (current != null) { Path cliPath = current.resolve("nodejs/node_modules/@github/copilot/index.js");