@@ -75,6 +75,42 @@ def update_package_version_by_patch(package_manifest_path):
7575 return new_package_version
7676
7777
78+ def regenerate_wrench ():
79+ """
80+ It runs Tools/regenerate-ci.cmd OR Tools/regenerate-ci.sh script
81+ to regenerate the CI files. (depending on the OS)
82+
83+ This is needed because wrench scripts content is created dynamically depending on the available editors
84+ """
85+
86+ # --- Regenerate the CI files ---
87+ print ("\n Regenerating CI files..." )
88+ script_path = ""
89+ if platform .system () == "Windows" :
90+ script_path = os .path .join ('Tools' , 'CI' , 'regenerate-ci.bat' )
91+ else : # macOS and Linux
92+ script_path = os .path .join ('Tools' 'CI' , 'regenerate-ci.sh' )
93+
94+ if not os .path .exists (script_path ):
95+ print (f"Error: Regeneration script not found at '{ script_path } '." )
96+ return
97+
98+ try :
99+ # Execute the regeneration script
100+ # On non-Windows systems, the script might need execute permissions.
101+ if platform .system () != "Windows" :
102+ os .chmod (script_path , 0o755 )
103+
104+ print (f"Running '{ script_path } '..." )
105+ subprocess .run ([script_path ], check = True , shell = True )
106+ print ("CI regeneration completed successfully." )
107+
108+ except subprocess .CalledProcessError as e :
109+ print (f"Error: The CI regeneration script failed with exit code { e .returncode } ." )
110+ except Exception as e :
111+ print (f"An unexpected error occurred while running the regeneration script: { e } " )
112+
113+
78114def update_validation_exceptions (validation_file , package_version ):
79115 """
80116 Updates the ValidationExceptions.json file with the new package version.
0 commit comments