[gen_image] Fixed bug where joined.flac would not be renamed to ${TARGET} when first attempt at joining them failed

This commit is contained in:
ayakael 2018-08-22 08:11:22 -08:00
parent 122efb71db
commit 1dd176fe47
No known key found for this signature in database
GPG key ID: 23B5A7E87EF83471

View file

@ -28,11 +28,11 @@ gen_image() {
echo ${fileList[@]} echo ${fileList[@]}
shntool join -O always ${fileList[@]} -d "${TARGET_DIR}" -o flac -q shntool join -O always ${fileList[@]} -d "${TARGET_DIR}" -o flac -q
[[ $? -ne 0 ]] && return 1 [[ $? -ne 0 ]] && return 1
return 2 local WARN=true
fi fi
fi fi
metaflac --remove-all --dont-use-padding "${TARGET_DIR}/joined.flac" metaflac --remove-all --dont-use-padding "${TARGET_DIR}/joined.flac"
mv "${TARGET_DIR}/joined.flac" "${TARGET}" mv "${TARGET_DIR}/joined.flac" "${TARGET}"
return 0 [[ ${WARN} == "true" ]] && return 2 || return 0
} }