Skip to content

Commit 9594e2b

Browse files
authored
Handle verbosity in extract image for non-returning errors (#17)
1 parent c9553b0 commit 9594e2b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/runtime/runtime.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,9 @@ bool extract_appimage(const char* const appimage_path, const char* const _prefix
722722
struct stat st;
723723
if (!overwrite && stat(prefixed_path_to_extract, &st) == 0 &&
724724
st.st_size == inode.xtra.reg.file_size) {
725-
// fprintf(stderr, "File exists and file size matches, skipping\n");
725+
if (verbose) {
726+
fprintf(stderr, "File exists and file size matches, skipping\n");
727+
}
726728
continue;
727729
}
728730

@@ -1410,7 +1412,9 @@ int main(int argc, char* argv[]) {
14101412
exit(1);
14111413
}
14121414

1413-
if (!extract_appimage(appimage_path, "squashfs-root/", pattern, true, true)) {
1415+
const bool verbose = (getenv("VERBOSE") != NULL);
1416+
1417+
if (!extract_appimage(appimage_path, "squashfs-root/", pattern, true, verbose)) {
14141418
exit(1);
14151419
}
14161420

0 commit comments

Comments
 (0)