Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
986b8d62a7
|
|||
654cc688cf
|
|||
9872fef555
|
|||
fe3a0dce44
|
13
HISTORY.md
Normal file
13
HISTORY.md
Normal 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`
|
18
README.md
18
README.md
@ -7,6 +7,13 @@
|
|||||||
Utility parse Minecraft JE game version file (`version.json`) and returns
|
Utility parse Minecraft JE game version file (`version.json`) and returns
|
||||||
libraries list for specified operation system.
|
libraries list for specified operation system.
|
||||||
|
|
||||||
|
**How to build from source:**
|
||||||
|
|
||||||
|
```sh
|
||||||
|
conan install .
|
||||||
|
make
|
||||||
|
```
|
||||||
|
|
||||||
**How to use:**
|
**How to use:**
|
||||||
|
|
||||||
```
|
```
|
||||||
@ -18,7 +25,7 @@ Usage:
|
|||||||
<system> - w|l|x (windows or linux or osx)
|
<system> - w|l|x (windows or linux or osx)
|
||||||
|
|
||||||
Other:
|
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,
|
Utility has two required arguments,
|
||||||
@ -41,6 +48,13 @@ wget https://piston-meta.mojang.com/v1/packages/68cded4616fba9fbefb3f895033c2611
|
|||||||
Утилита парсит файл версий (`version.json`) Minecraft JE и возвращает
|
Утилита парсит файл версий (`version.json`) Minecraft JE и возвращает
|
||||||
список библиотек для указанной операционной системы.
|
список библиотек для указанной операционной системы.
|
||||||
|
|
||||||
|
**Как скомпилировать:**
|
||||||
|
|
||||||
|
```sh
|
||||||
|
conan install .
|
||||||
|
make
|
||||||
|
```
|
||||||
|
|
||||||
**Как использовать:**
|
**Как использовать:**
|
||||||
|
|
||||||
```
|
```
|
||||||
@ -52,7 +66,7 @@ Usage:
|
|||||||
<system> - w|l|x (windows or linux or osx)
|
<system> - w|l|x (windows or linux or osx)
|
||||||
|
|
||||||
Other:
|
Other:
|
||||||
make-libs-string <version.json> s - to get info
|
make-libs-string <version.json> i - to get version info
|
||||||
```
|
```
|
||||||
|
|
||||||
Программа имеет два обязательных аргумента,
|
Программа имеет два обязательных аргумента,
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <cjson/cJSON.h>
|
#include <cjson/cJSON.h>
|
||||||
|
|
||||||
#define VERSION "1.0.0" // software version
|
#define VERSION "1.0.1" // software version
|
||||||
|
|
||||||
void usage();
|
void usage();
|
||||||
void info(cJSON *json);
|
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[])
|
int main(int argc, char const *argv[])
|
||||||
{
|
{
|
||||||
if (argc < 2 || argc > 3)
|
if (argc != 3)
|
||||||
{
|
{
|
||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
@ -46,7 +46,7 @@ int main(int argc, char const *argv[])
|
|||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 'i':
|
||||||
info(json);
|
info(json);
|
||||||
break;
|
break;
|
||||||
case 'w':
|
case 'w':
|
||||||
@ -80,12 +80,15 @@ void usage()
|
|||||||
printf(" %s\n\n", "make-libs-string <version.json> <system>");
|
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\n", "<system> - w|l|x (windows or linux or osx)");
|
||||||
printf("%s\n", "Other:");
|
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)
|
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);
|
printf("Minecraft Assets Version: %s\n", assets_version);
|
||||||
|
|
||||||
cJSON *libraries = cJSON_GetObjectItem(json, "libraries");
|
cJSON *libraries = cJSON_GetObjectItem(json, "libraries");
|
||||||
|
Reference in New Issue
Block a user