diff --git a/firmware/gen_signature.sh b/firmware/gen_signature.sh index f154d82845..5f2d488b78 100755 --- a/firmware/gen_signature.sh +++ b/firmware/gen_signature.sh @@ -31,10 +31,10 @@ else fi echo "#define TS_SIGNATURE \"rusEFI $branchname.$date.${SHORT_BOARD_NAME}.@@SIGNATURE_HASH@@\"" >> ${TEMP_FILE} -# -# TODO: what's going on here? signature*txt is excluded from git by tunerstudio/.gitignore let's have a code comment explaining the logic below! -# -cmp ${TEMP_FILE} ${SIGNATURE_FILE_NAME} || mv -f ${TEMP_FILE} ${SIGNATURE_FILE_NAME} + +# cmp compares files to see if they are different. If they are different or if SIGNATURE_FILE_NAME doesn't exist, the mv command will run. +# We redirect errors to /dev/null to supress the error if SIGNATURE_FILE_NAME doesn't exsit +cmp ${TEMP_FILE} ${SIGNATURE_FILE_NAME} 2>/dev/null || mv -f ${TEMP_FILE} ${SIGNATURE_FILE_NAME} rm -f ${TEMP_FILE} exit 0