4 Commits
1.0.0 ... 1.0.1

Author SHA1 Message Date
986b8d62a7 1.0.1 2022-09-13 23:31:10 +03:00
654cc688cf change argv letter s to i 2022-09-13 23:26:02 +03:00
9872fef555 fix bad assets_version value 2022-09-13 23:15:36 +03:00
fe3a0dce44 build guide 2022-08-28 22:29:08 +03:00
3 changed files with 37 additions and 7 deletions

13
HISTORY.md Normal file
View File

@ -0,0 +1,13 @@
## Legend
- 🐛 - Bug
- ✔️ - Fixed
- ❌ - Removed
- - Added
- - Information
- ♻️ - Edited
> This project use Semantic Versioning 2.0.0 https://semver.org/
## 13/09/2022 - (1.0.1)
- ✔️ - Fixed bad returned value of `assets_version`
- ♻️ - Changed the letter argument of the program to return version information from `s` to `i`

View File

@ -7,6 +7,13 @@
Utility parse Minecraft JE game version file (`version.json`) and returns
libraries list for specified operation system.
**How to build from source:**
```sh
conan install .
make
```
**How to use:**
```
@ -18,7 +25,7 @@ Usage:
<system> - w|l|x (windows or linux or osx)
Other:
make-libs-string <version.json> s - to get info
make-libs-string <version.json> i - to get version info
```
Utility has two required arguments,
@ -41,6 +48,13 @@ wget https://piston-meta.mojang.com/v1/packages/68cded4616fba9fbefb3f895033c2611
Утилита парсит файл версий (`version.json`) Minecraft JE и возвращает
список библиотек для указанной операционной системы.
**Как скомпилировать:**
```sh
conan install .
make
```
**Как использовать:**
```
@ -52,7 +66,7 @@ Usage:
<system> - w|l|x (windows or linux or osx)
Other:
make-libs-string <version.json> s - to get info
make-libs-string <version.json> i - to get version info
```
Программа имеет два обязательных аргумента,

View File

@ -8,7 +8,7 @@
#include <string.h>
#include <cjson/cJSON.h>
#define VERSION "1.0.0" // software version
#define VERSION "1.0.1" // software version
void usage();
void info(cJSON *json);
@ -16,7 +16,7 @@ void generate_library_list(cJSON *input_json, cJSON *output_json, char output_sy
int main(int argc, char const *argv[])
{
if (argc < 2 || argc > 3)
if (argc != 3)
{
usage();
}
@ -46,7 +46,7 @@ int main(int argc, char const *argv[])
default:
usage();
break;
case 's':
case 'i':
info(json);
break;
case 'w':
@ -80,12 +80,15 @@ void usage()
printf(" %s\n\n", "make-libs-string <version.json> <system>");
printf(" %s\n\n", "<system> - w|l|x (windows or linux or osx)");
printf("%s\n", "Other:");
printf(" %s\n", "make-libs-string <version.json> s - to get info");
printf(" %s\n", "make-libs-string <version.json> i - to get version info");
}
void info(cJSON *json)
{
char *assets_version = cJSON_GetStringValue(cJSON_GetObjectItem(json, "id"));
char *minecraft_version = cJSON_GetStringValue(cJSON_GetObjectItem(json, "id"));
printf("Minecraft Version: %s\n", minecraft_version);
char *assets_version = cJSON_GetStringValue(cJSON_GetObjectItem(json, "assets"));
printf("Minecraft Assets Version: %s\n", assets_version);
cJSON *libraries = cJSON_GetObjectItem(json, "libraries");