Skip to content

Prevent rewriting core_version.h if content unchanged #6414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions tools/makecorever.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,19 @@ def git(*args):
except:
pass

text = "#define ARDUINO_ESP8266_GIT_VER 0x{}\n".format(git_ver)
text += "#define ARDUINO_ESP8266_GIT_DESC {}\n".format(git_desc)

try:
with open(path, "r") as inp:
old_text = inp.read()
if old_text == text:
return
except:
pass

with open(path, "w") as out:
out.write("#define ARDUINO_ESP8266_GIT_VER 0x{}\n".format(git_ver))
out.write("#define ARDUINO_ESP8266_GIT_DESC {}\n".format(git_desc))
out.write(text)


if __name__ == "__main__":
Expand Down