@@ -107,7 +107,7 @@ error() {
|
||||
# 3: no handler
|
||||
handle_target() {
|
||||
declare -n result=$1
|
||||
declare h cmd regex target_is_file target target_left cmd_is_template
|
||||
declare h cmd regex target_is_file target target_left cmd_is_template _ec
|
||||
cmd_append_target=1
|
||||
match=0
|
||||
target=$2
|
||||
@@ -118,9 +118,10 @@ handle_target() {
|
||||
|
||||
[[ "$target" =~ ^/.* ]] || { target="${PWD}/${target}"; } # Turn relative paths to absolute ones.
|
||||
|
||||
file_raw=$( file -ib "$target" )
|
||||
(( $? )) && {
|
||||
file_raw=$( file -ib "$target" ); _ec=$?
|
||||
(( $_ec )) && {
|
||||
error "Failed to get mimetype, bailing"
|
||||
result=$_ec
|
||||
return 1
|
||||
}
|
||||
|
||||
@@ -130,9 +131,10 @@ handle_target() {
|
||||
|
||||
[[ $target_mimetype == 'inode/symlink' ]] && {
|
||||
unset file_raw
|
||||
file_raw=$( file -ibL "$target" )
|
||||
(( $? )) && {
|
||||
file_raw=$( file -ibL "$target" ); _ec=$?
|
||||
(( $_ec )) && {
|
||||
error "Failed to get mimetype, bailing"
|
||||
result=$_ec
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user