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:
parent
adfc28d7d8
commit
f2bac1cae9
@ -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__":
|
||||
|
Loading…
x
Reference in New Issue
Block a user