mirror of
https://github.com/YunoHost/yunodevtools.git
synced 2024-09-03 20:16:19 +02:00
Fix regex to replace version in manifest
This regex is used to find (textually, not via toml parser) where to replace the version number in the Manifest. Until now it was only supporting version numbers containing dots and digits. I changed that to version numbers containing anything but ~ and " to handle version numbers with dashes, or manually written version numbers that might be invalid (if someone litteraly writes `version = "x.y~ynh1"). We don’t actually care about the version number we match against because we just replace it.
This commit is contained in:
parent
f276a08728
commit
fb15a5ff94
1 changed files with 1 additions and 1 deletions
|
@ -480,7 +480,7 @@ class AppAutoUpdater:
|
|||
if is_main:
|
||||
def repl(m: re.Match) -> str:
|
||||
return m.group(1) + new_version + '~ynh1"'
|
||||
content = re.sub(r"(\s*version\s*=\s*[\"\'])([\d\.]+)(\~ynh\d+[\"\'])", repl, content)
|
||||
content = re.sub(r"(\s*version\s*=\s*[\"\'])([^~\"\']+)(\~ynh\d+[\"\'])", repl, content)
|
||||
|
||||
for old, new in replacements:
|
||||
content = content.replace(old, new)
|
||||
|
|
Loading…
Add table
Reference in a new issue