aboutsummaryrefslogtreecommitdiff
path: root/version.sh
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-03-12 11:03:54 +0100
committerThomas White <taw@physics.org>2018-03-12 11:03:54 +0100
commit22a361c6c15f54c02161c8dc9a81d2f0ed2c9d8c (patch)
tree401629a23b07c1459814678e4b4252c411e84bf1 /version.sh
parent3f292d64b65869659eb1015ccd79ad6fdf476f61 (diff)
Update version.sh
Diffstat (limited to 'version.sh')
-rwxr-xr-xversion.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/version.sh b/version.sh
index 1be14f69..ce74e37e 100755
--- a/version.sh
+++ b/version.sh
@@ -16,10 +16,15 @@ if [ $? -eq 0 ]; then
fi
fi
sed 's/\$e\$/'${CRYSTFEL_GIT_COMMIT}'/g' version1.tmp > version2.tmp
-diff version.h version2.tmp > /dev/null
-if [ $? -ne 0 ]; then
+if [ -f version.h ]; then
+ diff version.h version2.tmp > /dev/null
+ if [ $? -ne 0 ]; then
+ mv version2.tmp version.h
+ rm version1.tmp
+ else
+ rm version1.tmp version2.tmp
+ fi
+else
mv version2.tmp version.h
rm version1.tmp
-else
- rm version1.tmp version2.tmp
fi