diff --git a/snapcraft/commands/lifecycle.py b/snapcraft/commands/lifecycle.py index b15b617fee..7cdfdc6c87 100644 --- a/snapcraft/commands/lifecycle.py +++ b/snapcraft/commands/lifecycle.py @@ -17,7 +17,6 @@ """Snapcraft lifecycle commands.""" import argparse -import pathlib import textwrap from typing import Any @@ -29,7 +28,7 @@ import snapcraft.pack -class PackCommand(craft_application.commands.LifecycleCommand): +class PackCommand(craft_application.commands.lifecycle.PackCommand): """Snapcraft pack command.""" name = "pack" @@ -55,13 +54,6 @@ def _fill_parser(self, parser: argparse.ArgumentParser) -> None: default=None, help="Directory to pack", ) - parser.add_argument( - "--output", - "-o", - type=pathlib.Path, - default=pathlib.Path(), - help="Output directory for created packages", - ) @override def _run( @@ -78,22 +70,7 @@ def _run( ) emit.message(f"Packed {snap_filename}") else: - super()._run(parsed_args, step_name="prime") - self._services.package.update_project() - self._services.package.write_metadata(self._services.lifecycle.prime_dir) - - emit.progress("Packing...") - packages = self._services.package.pack( - self._services.lifecycle.prime_dir, parsed_args.output - ) - - if not packages: - emit.progress("No packages created.", permanent=True) - elif len(packages) == 1: - emit.progress(f"Packed {packages[0].name}", permanent=True) - else: - package_names = ", ".join(pkg.name for pkg in packages) - emit.progress(f"Packed: {package_names}", permanent=True) + super()._run(parsed_args) @override def needs_project(self, parsed_args: argparse.Namespace) -> bool: