Improve this

This commit is contained in:
Lncvrt committed 2026-03-11 22:16:36 -07:00
1 parent 0c69670fdc
commit 48ab4a5203
1 file changed
+2 -8
+2 -8
View File
@@ -7,18 +7,14 @@ void version_command(int argc, char *argv[]) {
printf("Current TBCLI Version: %s\n", PROJECT_VERSION);
char *body = http_get("https://git.lncvrt.xyz/api/v1/repos/TBCLI/cli/tags");
if (!body) {
fprintf(stderr, "Failed to fetch tags\n");
if (!body)
return;
}
cJSON *json = cJSON_Parse(body);
free(body);
if (!json) {
fprintf(stderr, "Failed to parse JSON\n");
if (!json)
return;
}
cJSON *latest = cJSON_GetArrayItem(json, cJSON_GetArraySize(json) - 1);
if (latest) {
@@ -26,8 +22,6 @@ void version_command(int argc, char *argv[]) {
if (cJSON_IsString(name)) {
printf("Latest TBCLI Version: %s\n", name->valuestring);
}
} else {
printf("No tags found.\n");
}
cJSON_Delete(json);