1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-27 21:16:50 +03:00

Prevent rewriting core_version.h if content unchanged (#6414)

This commit is contained in:
Dirk O. Kaar 2019-08-12 22:28:19 +02:00 committed by Earle F. Philhower, III
parent adfc28d7d8
commit f2bac1cae9

View File

@ -35,9 +35,19 @@ def generate(path, platform_path, git_ver="ffffffff", git_desc="unspecified"):
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__":