mirror of
https://github.com/maubot/maubot.git
synced 2024-10-01 01:06:10 -04:00
Fix uploading plugins with different versions
This commit is contained in:
parent
2bf1c41b53
commit
79c61d6889
@ -83,7 +83,7 @@ async def upload_replacement_plugin(plugin: ZippedPluginLoader, content: bytes,
|
|||||||
dirname = os.path.dirname(plugin.path)
|
dirname = os.path.dirname(plugin.path)
|
||||||
old_filename = os.path.basename(plugin.path)
|
old_filename = os.path.basename(plugin.path)
|
||||||
if str(plugin.meta.version) in old_filename:
|
if str(plugin.meta.version) in old_filename:
|
||||||
replacement = (new_version if plugin.meta.version != new_version
|
replacement = (str(new_version) if plugin.meta.version != new_version
|
||||||
else f"{new_version}-ts{int(time())}")
|
else f"{new_version}-ts{int(time())}")
|
||||||
filename = re.sub(f"{re.escape(str(plugin.meta.version))}(-ts[0-9]+)?",
|
filename = re.sub(f"{re.escape(str(plugin.meta.version))}(-ts[0-9]+)?",
|
||||||
replacement, old_filename)
|
replacement, old_filename)
|
||||||
|
Loading…
Reference in New Issue
Block a user