@@ -18,23 +18,23 @@ def replace_in_file(path, regex, replacement):
1818 outfile .write (line )
1919
2020def update_pre_commit_hook_script (path , version ):
21- replace_in_file (path , '--package-version=[\d.]+' , '--package-version={}' .format (version ))
21+ replace_in_file (path , '--package-version=[\\ d.]+' , '--package-version={}' .format (version ))
2222
2323def update_installer_script (path , version ):
24- replace_in_file (path , '#define MyAppVersion "[\d.]+"' , '#define MyAppVersion "{}"' .format (version ))
24+ replace_in_file (path , '#define MyAppVersion "[\\ d.]+"' , '#define MyAppVersion "{}"' .format (version ))
2525
2626def update_cpp_file (path , version ):
2727 version_parts = version .split ('.' )
2828
29- replace_in_file (path , 'Version::major = \d+;' , 'Version::major = {};' .format (version_parts [0 ]))
30- replace_in_file (path , 'Version::minor = \d+;' , 'Version::minor = {};' .format (version_parts [1 ]))
31- replace_in_file (path , 'Version::patch = \d+;' , 'Version::patch = {};' .format (version_parts [2 ]))
29+ replace_in_file (path , 'Version::major = \\ d+;' , 'Version::major = {};' .format (version_parts [0 ]))
30+ replace_in_file (path , 'Version::minor = \\ d+;' , 'Version::minor = {};' .format (version_parts [1 ]))
31+ replace_in_file (path , 'Version::patch = \\ d+;' , 'Version::patch = {};' .format (version_parts [2 ]))
3232
3333def update_resource_file (path , version ):
3434 comma_separated_version = version .replace ('.' , ', ' )
3535
36- replace_in_file (path , 'VERSION \d+, \d+, \d+' , 'VERSION {}' .format (comma_separated_version ))
37- replace_in_file (path , 'Version", "\d+\.\ d+\. \d+"' , 'Version", "{}"' .format (version ))
36+ replace_in_file (path , 'VERSION \\ d+, \\ d+, \ \ d+' , 'VERSION {}' .format (comma_separated_version ))
37+ replace_in_file (path , 'Version", "\\ d+\\ . \\ d+\\ . \ \ d+"' , 'Version", "{}"' .format (version ))
3838
3939if __name__ == "__main__" :
4040 parser = argparse .ArgumentParser (description = 'Set the LOOT version number' )
0 commit comments