Skip to content

Commit a7813b6

Browse files
committed
Update version to 0.3.9-STABLE and improve route handling in JobGetInfos
1 parent e38ed54 commit a7813b6

4 files changed

Lines changed: 9 additions & 6 deletions

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group = 'fr.sandro642.github'
8-
version = '0.3.8.3-STABLE'
8+
version = '0.3.9-STABLE'
99

1010
// Générer une classe de version automatiquement
1111
task generateVersionClass {

src/main/java/fr/sandro642/github/jobs/JobGetInfos.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ public <R> JobGetInfos getRoutes(VersionProvider versionType, MethodType methodT
189189
String fullRoute;
190190

191191
if (versionType != null && versionType.getVersion() != null) {
192-
fullRoute = "/" + versionType.getVersion() + route;
192+
String cleanRoute = route.startsWith("/") ? route.substring(1) : route;
193+
fullRoute = "/" + versionType.getVersion() + "/" + cleanRoute;
193194
} else {
194195
fullRoute = route;
195196
}

src/main/java/fr/sandro642/github/update/RetrieveLastVersion.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,13 @@ public String fetchVersion() {
5757
* If they are different, it prints a message indicating that a new version is available.
5858
*/
5959
public void isLatestVersion() {
60+
String CONNECTLIB = "\u001B[94m[ConnectLib] \u001B[0m";
61+
6062
String fetchedVersion = fetchVersion();
6163
if (fetchedVersion.equals("Error") || fetchedVersion.equals("No tags found")) {
62-
System.out.println("Could not fetch the latest version.");
64+
System.out.println(CONNECTLIB + "Could not fetch the latest version.");
6365
} else if (!fetchedVersion.equals(Version.VERSION)) {
64-
System.out.println("A new version is available: " + fetchedVersion + ". You can download it from https://connectlib.xyz/#downloads");
66+
System.out.println(CONNECTLIB + "A new version is available: " + fetchedVersion + ". You can download it from https://connectlib.xyz/#downloads");
6567
}
6668
}
6769

src/test/java/fr/sandro642/github/test/MainTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class MainTest {
2727
private static final ConnectLib connectLib = new ConnectLib();
2828

2929
public enum TestRoutes implements RouteImport {
30-
HELLO("hello"),
30+
HELLO("/hello"),
3131
GREET("greet$name$")
3232
;
3333

@@ -135,7 +135,7 @@ public void testLangType() {
135135

136136
try {
137137
CompletableFuture<ApiFactory> factoryCompletableFuture = connectLib.JobGetInfos()
138-
.getRoutes(MethodType.GET, TestRoutes.HELLO)
138+
.getRoutes(TestCustomVersion.DEV_BRANCH, MethodType.GET, TestRoutes.HELLO)
139139

140140
/**
141141
* You can change the URL of the API here if you want to use another URL than the one in the config file.

0 commit comments

Comments
 (0)