Skip to content

Commit f2bac1c

Browse files
dok-netearlephilhower
authored andcommitted
Prevent rewriting core_version.h if content unchanged (#6414)
1 parent adfc28d commit f2bac1c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Diff for: tools/makecorever.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,19 @@ def git(*args):
3535
except:
3636
pass
3737

38+
text = "#define ARDUINO_ESP8266_GIT_VER 0x{}\n".format(git_ver)
39+
text += "#define ARDUINO_ESP8266_GIT_DESC {}\n".format(git_desc)
40+
41+
try:
42+
with open(path, "r") as inp:
43+
old_text = inp.read()
44+
if old_text == text:
45+
return
46+
except:
47+
pass
48+
3849
with open(path, "w") as out:
39-
out.write("#define ARDUINO_ESP8266_GIT_VER 0x{}\n".format(git_ver))
40-
out.write("#define ARDUINO_ESP8266_GIT_DESC {}\n".format(git_desc))
50+
out.write(text)
4151

4252

4353
if __name__ == "__main__":

0 commit comments

Comments
 (0)