-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(lifecycle): add deprecated snap command
- Loading branch information
Showing
4 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- | ||
# | ||
# Copyright 2024 Canonical Ltd. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License version 3 as | ||
# published by the Free Software Foundation. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
"""Snapcraft lifecycle commands.""" | ||
|
||
import argparse | ||
from typing import Any | ||
|
||
import craft_application.commands | ||
from craft_cli import emit | ||
from typing_extensions import override | ||
|
||
# pylint: disable=too-many-ancestors | ||
|
||
|
||
class SnapCommand(craft_application.commands.lifecycle.PackCommand): | ||
"""Deprecated legacy command to pack the final snap payload.""" | ||
|
||
name = "snap" | ||
hidden = True | ||
|
||
@override | ||
def _run( | ||
self, | ||
parsed_args: argparse.Namespace, | ||
step_name: str | None = None, | ||
**kwargs: Any, | ||
) -> None: | ||
emit.progress( | ||
"Warning: the 'snap' command is deprecated and will be removed " | ||
"in a future release of Snapcraft. Please use 'pack' instead.", | ||
permanent=True, | ||
) | ||
|
||
super()._run(parsed_args, step_name, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters