diff options
| author | Tristan Riehs <tristan.riehs@inria.fr> | 2026-05-31 17:27:25 +0200 |
|---|---|---|
| committer | Tristan Riehs <tristan.riehs@inria.fr> | 2026-05-31 17:27:25 +0200 |
| commit | 784b87aab4add9db1d316d85c85f1aa40d63ac00 (patch) | |
| tree | 4e032ad8c793c7d562afc876d5d463b2aa37a286 /src/utils.c | |
| parent | 9b69b2ff7563fb89ea8589d307a1c0b83cd6ed7f (diff) | |
Integrate config to the rest of the code
Compile-time values such as DATABASE_PATH are no longer needed.
Diffstat (limited to 'src/utils.c')
| -rw-r--r-- | src/utils.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/utils.c b/src/utils.c index a1fc5b9..9ad9190 100644 --- a/src/utils.c +++ b/src/utils.c @@ -50,17 +50,18 @@ int str_has_suffix(const char *str, const char *suffix) void assert_db_exists(void) { - if (file_exists(DATABASE_PATH)) + const char *db_path = ftag_config_get(FC_DATABASE_PATH); + if (file_exists(db_path)) return; if (errno == ENOENT) { fprintf(stderr, "ftag: database not found at \"%s\", " "have you run \"ftag init\"?\n", - DATABASE_PATH); + db_path); } else { - perror(DATABASE_PATH); + perror(db_path); } exit(EXIT_FAILURE); } |
