We need to check the exit code of file
Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
@@ -118,12 +118,14 @@ handle_target() {
|
|||||||
|
|
||||||
[[ "$target" =~ ^/.* ]] || { target="${PWD}/${target}"; } # Turn relative paths to absolute ones.
|
[[ "$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"
|
error "Failed to get mimetype, bailing"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IFS=';' read target_mimetype _ <<< "$file_raw"
|
||||||
|
|
||||||
target_left=$target_mimetype
|
target_left=$target_mimetype
|
||||||
|
|
||||||
[[ $target_mimetype == 'inode/symlink' ]] && \
|
[[ $target_mimetype == 'inode/symlink' ]] && \
|
||||||
|
|||||||
Reference in New Issue
Block a user