[export_meta] Fixed bug where the path would not be updated once exported

This commit is contained in:
ayakael 2019-04-09 19:29:54 -04:00
parent 4318ea9622
commit d146a619b6
Signed by untrusted user who does not match committer: forge
GPG key ID: D62A472A4AA7D541

View file

@ -46,7 +46,7 @@ export_meta() {
mv "${TARGET}/${PRESENT_PATH}" "${TARGET}/${FUTURE_PATH}" mv "${TARGET}/${PRESENT_PATH}" "${TARGET}/${FUTURE_PATH}"
[[ $? -eq 0 ]] || local ERR=true [[ $? -eq 0 ]] || local ERR=true
rmdir -p --ignore-fail-on-non-empty "$(dirname "${TARGET}/${PRESENT_PATH}")" >/dev/null 2>&1 rmdir -p --ignore-fail-on-non-empty "$(dirname "${TARGET}/${PRESENT_PATH}")" >/dev/null 2>&1
[[ -f "${FUTURE_PATH}" ]] && gawk -i inplace -v trackid=${trackid} -v value="${FUTURE_PATH}" 'BEGIN{FS="\t";OFS="\t"}{if($3==trackid){$4=value}{print $0}}' ${DB_FILE} [[ -f "${TARGET}/${FUTURE_PATH}" ]] && gawk -i inplace -v trackid=${trackid} -v value="${FUTURE_PATH}" 'BEGIN{FS="\t";OFS="\t"}{if($3==trackid){$4=value}{print $0}}' ${DB_FILE}
fi fi
done done
[[ "${ERR}" == "true" ]] && return 1 || return 0 [[ "${ERR}" == "true" ]] && return 1 || return 0