From 5994b655acc30ba0e0f97dc6c5d59e7229d36681 Mon Sep 17 00:00:00 2001 From: adwait <53764708+aoxolotl@users.noreply.github.com> Date: Fri, 1 Sep 2023 23:18:03 -0400 Subject: [PATCH] Hnadle verbosity in extract_appimage for non-returning errors --- src/runtime.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/runtime.c b/src/runtime.c index e6cd989d..daf571f0 100644 --- a/src/runtime.c +++ b/src/runtime.c @@ -361,7 +361,9 @@ bool extract_appimage(const char* const appimage_path, const char* const _prefix } else { struct stat st; if (!overwrite && stat(prefixed_path_to_extract, &st) == 0 && st.st_size == inode.xtra.reg.file_size) { - fprintf(stderr, "File exists and file size matches, skipping\n"); + if (verbose) { + fprintf(stderr, "File exists and file size matches, skipping\n"); + } continue; } @@ -656,7 +658,9 @@ int main(int argc, char *argv[]) { exit(1); } - if (!extract_appimage(appimage_path, "squashfs-root/", pattern, true, true)) { + const bool verbose = (getenv("VERBOSE") != NULL); + + if (!extract_appimage(appimage_path, "squashfs-root/", pattern, true, verbose)) { exit(1); }