From 8e8751eb3501d6096e09621551491c714ef2e656 Mon Sep 17 00:00:00 2001 From: adwait <53764708+aoxolotl@users.noreply.github.com> Date: Wed, 27 Sep 2023 16:51:20 -0400 Subject: [PATCH] Handle verbosity in extract image for non-returning errors --- src/runtime/runtime.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/runtime/runtime.c b/src/runtime/runtime.c index 07a5205..2fe0261 100644 --- a/src/runtime/runtime.c +++ b/src/runtime/runtime.c @@ -722,7 +722,9 @@ bool extract_appimage(const char* const appimage_path, const char* const _prefix 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; } @@ -1410,7 +1412,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); }