import contextlib

import click

from snafu import metadata, operations, versions


def get_version_or_none(name):
    force_32 = not metadata.can_install_64bit()
    with contextlib.suppress(versions.VersionNotFoundError):
        return versions.get_version(name, force_32=force_32)
    return None


@click.command()
def main():
    versions = [
        get_version_or_none(name)
        for name in operations.get_active_names()
    ]
    for version in versions:
        if version is None:
            continue
        operations.publish_version_scripts(version)


if __name__ == '__main__':
    main()

@@ -342,16 +342,41 @@
 ons = %5B%0A
+        v for v in (%0A    
         
@@ -401,16 +401,20 @@
 e(name)%0A
+    
         
@@ -463,138 +463,87 @@
     
-%5D%0A
     
-for version in versions:%0A        if version is None:%0A            continue%0A        operations.publish_version_scripts(version
+) if v is not None%0A    %5D%0A    operations.activate(versions, allow_empty=True
 )%0A%0A%0A

Fix activation