From 86bfbfc7f264e07515b75611142243fde45da465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Sat, 11 Jun 2022 14:57:31 +0300 Subject: Remove false error messages from dry-run mode --- README.md | 5 +++-- src/fs.c | 4 +++- src/site.c | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5e8a2ee..3511fcf 100644 --- a/README.md +++ b/README.md @@ -27,5 +27,6 @@ system, or read the contents in `docs/` in the source. ## TODO: * Add exif tags to template hashmap. -* Better test coverage? (if I am not too lazy) -* Document. +* Re-render album html when an album.ini has changed. +* Better test coverage? (if I am not too lazy). +* Document templates. diff --git a/src/fs.c b/src/fs.c index b6ec372..b2c94c8 100644 --- a/src/fs.c +++ b/src/fs.c @@ -206,7 +206,9 @@ rmextra(const char *path, struct hmap *preserved, preremove_fn cb, { ssize_t removed = 0; DIR *dir = opendir(path); - if (dir == NULL) return -1; + if (dir == NULL) { + return dry ? 0 : -1; + } struct dirent *ent; while ((ent = readdir(dir))) { diff --git a/src/site.c b/src/site.c index f26907e..eedd30b 100644 --- a/src/site.c +++ b/src/site.c @@ -202,7 +202,7 @@ images_walk(struct bstnode *node, void *data) } success: - setdatetime(image->dst, &ddate); + if (!site->dry_run) setdatetime(image->dst, &ddate); return true; magick_fail: return false; -- cgit v1.2.3