Skip to content

Commit

Permalink
Merge pull request #26 from bdring/Devt
Browse files Browse the repository at this point in the history
Devt
  • Loading branch information
bdring authored Sep 25, 2021
2 parents 254ee24 + c73ba84 commit 830ffee
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion git-version.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,16 @@
fp.write('const char* grbl_version = \"' + grbl_version + '\";\n')
fp.write('const char* git_info = \"' + git_info + '\";\n')

if not (os.path.exists(final) and filecmp.cmp(provisional, final)):
if not os.path.exists(final):
# No version.cpp so rename version.cxx to version.cpp
os.rename(provisional, final)
elif not filecmp.cmp(provisional, final):
# version.cxx differs from version.cpp so get rid of the
# old .cpp and rename .cxx to .cpp
os.remove(final)
os.rename(provisional, final)
else:
# The existing version.cpp is the same as the new version.cxx
# so we can just leave the old version.cpp in place and get
# rid of version.cxx
os.remove(provisional)

0 comments on commit 830ffee

Please sign in to comment.