Skip to content

Commit 4611325

Browse files
committed
Rename index override env var and store index with new filename
1 parent 1b6950f commit 4611325

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ Note that the flag needs to be added as prefix (e.g. `version = "^11.0.16.1+1"`)
124124
After running the `upgrade` command, the `install` command needs to be executed again to install the upgraded tools.
125125

126126
## Custom index
127-
The `PROJECT_ENV_TOOL_INDEX` env var can be used to specify a custom index URL. Note that the custom index needs to follow the format of the V2 format (see https://github.com/Project-Env/project-env-tools/blob/main/index-v2.json).
127+
The `PROJECT_ENV_TOOL_INDEX_V2` env var can be used to specify a custom index URL. Note that the custom index needs to follow the format of the V2 format (see https://github.com/Project-Env/project-env-tools/blob/main/index-v2.json).
128128

129129
## Cache
130130
All downloaded tool archives are cached, so they don't need to be downloaded multiple times.

code/cli/src/main/java/io/projectenv/core/cli/index/DefaultToolsIndexManager.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
public class DefaultToolsIndexManager implements ToolsIndexManager {
3030

3131
private static final String DEFAULT_TOOLS_INDEX_URL = "https://raw.githubusercontent.com/Project-Env/project-env-tools/main/index-v2.json";
32-
private static final String PROJECT_ENV_TOOL_INDEX_ENV = "PROJECT_ENV_TOOL_INDEX";
33-
private static final String TOOLS_INDEX_FILE = "tools-index.json";
32+
private static final String PROJECT_ENV_TOOL_INDEX_ENV = "PROJECT_ENV_TOOL_INDEX_V2";
33+
private static final String TOOLS_INDEX_FILE = "tools-index-v2.json";
3434

3535
private static final Gson GSON = GsonFactory.createGsonBuilder().create();
3636

code/cli/src/test/java/io/projectenv/core/cli/index/DefaultToolsIndexManagerCustomIndexTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class DefaultToolsIndexManagerCustomIndexTest {
1818
@Test
1919
void resolveMavenDistributionUrl() throws Exception {
2020
var url = getClass().getResource("custom-index.json").toString();
21-
try (var ignored = TestEnvironmentVariables.overlayEnv(Map.of("PROJECT_ENV_TOOL_INDEX", url))) {
21+
try (var ignored = TestEnvironmentVariables.overlayEnv(Map.of("PROJECT_ENV_TOOL_INDEX_V2", url))) {
2222
ToolsIndexManager manager = new DefaultToolsIndexManager(tempDir);
2323
assertThat(manager.resolveMavenDistributionUrl("customVersion")).isEqualTo("customVersionUrl");
2424
}

0 commit comments

Comments
 (0)