We need to check the exit code of file

Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
2026-11-28 05:12:54 +00:00
parent 6a92a3c6ad
commit a1710fccd7
+3 -1
View File
@@ -118,12 +118,14 @@ handle_target() {
[[ "$target" =~ ^/.* ]] || { target="${PWD}/${target}"; } # Turn relative paths to absolute ones.
IFS=';' read target_mimetype _ <<< $( file -ib "$target" )
file_raw=$( file -ib "$target" )
(( $? )) && {
error "Failed to get mimetype, bailing"
return 1
}
IFS=';' read target_mimetype _ <<< "$file_raw"
target_left=$target_mimetype
[[ $target_mimetype == 'inode/symlink' ]] && \