File tree Expand file tree Collapse file tree
src/test/java/com/github/copilot/sdk Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,9 +36,9 @@ public static String tempPath(String filename) {
3636 * <p>
3737 * Resolution order:
3838 * <ol>
39- * <li>Search the system PATH using {@code where.exe} (Windows) or {@code which}
40- * (Linux/macOS).</ li>
41- * <li>Fall back to the {@code COPILOT_CLI_PATH} environment variable .</li>
39+ * <li>Use the {@code COPILOT_CLI_PATH} environment variable when set.</li>
40+ * < li>Otherwise search the system PATH using {@code where.exe} (Windows) or
41+ * {@code which} (Linux/macOS) .</li>
4242 * <li>Walk parent directories looking for
4343 * {@code nodejs/node_modules/@github/copilot/index.js}.</li>
4444 * </ol>
@@ -55,16 +55,16 @@ public static String tempPath(String filename) {
5555 * {@code null} if none was found
5656 */
5757 static String findCliPath () {
58- String copilotInPath = findCopilotInPath ();
59- if (copilotInPath != null ) {
60- return copilotInPath ;
61- }
62-
6358 String envPath = System .getenv ("COPILOT_CLI_PATH" );
6459 if (envPath != null && !envPath .isEmpty ()) {
6560 return envPath ;
6661 }
6762
63+ String copilotInPath = findCopilotInPath ();
64+ if (copilotInPath != null ) {
65+ return copilotInPath ;
66+ }
67+
6868 Path current = Paths .get (System .getProperty ("user.dir" ));
6969 while (current != null ) {
7070 Path cliPath = current .resolve ("nodejs/node_modules/@github/copilot/index.js" );
You can’t perform that action at this time.
0 commit comments