build_nim.sh: also rebuild when the compiled commit is newer

than the last Nim repo commit (useful when switching branches)
This commit is contained in:
Ștefan Talpalaru 2019-10-02 14:51:39 +02:00
parent 9370c2bc58
commit 6261b66a25
No known key found for this signature in database
GPG Key ID: CBF7934204F1B6F9
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ nim_needs_rebuilding() {
fi
# compare the built commit's timestamp to the date of the last commit (keep in mind that Git doesn't preserve file timestamps)
if [[ -e "${NIM_DIR}/bin/timestamp" && $(cat "${NIM_DIR}/bin/timestamp") -ge $(cd "$NIM_DIR"; git log --pretty=format:%cd -n 1 --date=unix) ]]; then
if [[ -e "${NIM_DIR}/bin/timestamp" && $(cat "${NIM_DIR}/bin/timestamp") -ne $(cd "$NIM_DIR"; git log --pretty=format:%cd -n 1 --date=unix) ]]; then
return $NO_REBUILD
else
return $REBUILD