Compare commits

..

2 Commits

Author SHA1 Message Date
e537f385e4
creating .config dir if needed
Some checks failed
Codacy Scan / Codacy Security Scan (push) Failing after 1m57s
Build WHY2-chat / test-why2 (./out/why2-chat-client, ./configure.sh, ubuntu-latest, ./out/why2-chat-server) (push) Failing after 3m26s
Test Project / test-project (./configure.sh, gdb -ex "run" -ex "quit" --batch, ubuntu-latest, ./test) (push) Successful in 3m23s
Test WHY2-core / test-why2 (why2, ./configure.sh, gdb -ex "run" -ex "quit" --batch, ubuntu-latest, ./out/why2-core-test, valgrind --leak-check=full --show-leak-kinds=reachable --track-origins=yes -s) (push) Failing after 3m50s
Test WHY2-logger / test-why2 (why2-logger, ./configure.sh, gdb -ex "run" -ex "quit" --batch, ubuntu-latest, ./out/why2-logger-test, valgrind --leak-check=full --show-leak-kinds=reachable --track-origins=yes -s) (push) Failing after 4m34s
stupid gitea
2025-01-09 16:19:03 +01:00
0a7e9ecee7
created WHY2_USER_CONFIG_DIR macro
stupid gitea runner making me do shit
2025-01-09 16:15:55 +01:00
2 changed files with 10 additions and 1 deletions

View File

@ -51,7 +51,8 @@ enum WHY2_OUTPUT_FORMAT
#define WHY2_VERSION "v5.0" //WHY2_VERSION OF CURRENT BUILD > DO NOT TOUCH THIS <
#define WHY2_VERSIONS_URL "https://raw.githubusercontent.com/ENGO150/WHY2/release/versions.json" //URL FOR GETTING versions.json
#define WHY2_CONFIG_DIR "{HOME}/.config/WHY2"
#define WHY2_USER_CONFIG_DIR "{HOME}/.config"
#define WHY2_CONFIG_DIR WHY2_USER_CONFIG_DIR "/WHY2"
#define WHY2_VERSIONS_NAME WHY2_CONFIG_DIR "/.versions.json" //do I have to explain this?
#define WHY2_UPDATE_URL "https://github.com/ENGO150/WHY2.git" // REPOSITORY URL FOR UPDATES (YOU DON'T SAY)

View File

@ -56,15 +56,23 @@ int removeDirectory(char *path)
void why2_directory(void)
{
struct stat st;
char *buffer_2 = why2_replace(WHY2_USER_CONFIG_DIR, "{HOME}", getenv("HOME"));
char *buffer = why2_replace(WHY2_CONFIG_DIR, "{HOME}", getenv("HOME"));
//CREATE USER CONFIG FOLDER
if (stat(buffer_2, &st) == -1)
{
mkdir(buffer_2, 0700);
}
//CREATE WHY2 CONFIG FOLDER
if (stat(buffer, &st) == -1)
{
mkdir(buffer, 0700);
}
//DEALLOCATION
why2_deallocate(buffer_2);
why2_deallocate(buffer);
}