AppImage / AppImageKit

Package desktop applications as AppImages that run on common Linux-based operating systems, such as RHEL, CentOS, openSUSE, SLED, Ubuntu, Fedora, debian and derivatives. Join #AppImage on irc.libera.chat
http://appimage.org
Other
8.78k stars 563 forks source link

--appimage-extract <non-existant-file> exits 0 and no error message #866

Open HaleTom opened 6 years ago

HaleTom commented 6 years ago

I would expect that trying to extract a file which doesn't exist in the image would exit non-0.

<appimage> --appimage-extract <non-existant-file>

What I get is a null output and a 0 exit code (which by convention means that everything worked OK)

The exit code can be viewed with a POSIX compatible shell via: echo $?

Likewise I expect a human-readable error message when any of the requested files don't exist in the image.

TheAssassin commented 6 years ago

@HaleTom the syntax is my.AppImage --appimage-extract, that will extract my.AppImage to squashfs-root. I'm not sure what you're trying to do, please add more details.

probonopd commented 6 years ago

Likely my.AppImage --appimage-extract /some/non/extisting.file

HaleTom commented 6 years ago

Sorry, that wasn't clear. I've updated the top post.

probonopd commented 6 years ago

In another place we determined that in case of errors we should print a message but nevertheless continue extracting: https://github.com/AppImage/AppImageKit/issues/834

Keep in mind that --appimage-extract supports extracting multiple files using wildcards; thus I think this should apply here too. Just exiting with 1 on the first file that fails may be more concise but would also prevent users from extracting files that would otherwise be possible to be extracted.

HaleTom commented 6 years ago

@probonopd FYI I am aware of #363 and am already working around it.

I agree that exiting 1 immediately is premature, but if any part of the command failed I'd expect a non-0 exit code.

Possibly exit 2 for "a requested file doesn't exist" and exit 1 for IO error or other?

probonopd commented 6 years ago

PR highly welcome.