File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Common/Constants/include/CommonConstants Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,7 @@ def main():
196196
197197 # Get header content before and after the generated block.
198198 path_header = "PhysicsConstants.h"
199+ print (f"File { path_header } will be updated." )
199200 try :
200201 with open (path_header , encoding = "utf-8" ) as file :
201202 content_old = file .readlines ()
@@ -252,7 +253,15 @@ def main():
252253 * lines_header_after ,
253254 )
254255 )
255- print (content_new )
256+ # print(content_new)
257+
258+ try :
259+ with open (path_header , "w" , encoding = "utf-8" ) as file :
260+ file .write (content_new )
261+ print (f"File { path_header } has been overwritten." )
262+ except OSError :
263+ print (f'Failed to write to file "{ path_header } ".' )
264+ sys .exit (1 )
256265
257266
258267if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments