From 784b87aab4add9db1d316d85c85f1aa40d63ac00 Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Sun, 31 May 2026 17:27:25 +0200 Subject: Integrate config to the rest of the code Compile-time values such as DATABASE_PATH are no longer needed. --- src/utils.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/utils.c') 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); } -- cgit v1.2.3