Skip to content

Commit

Permalink
Add --no-publish/--no option to spk-convert-pip (#1015)
Browse files Browse the repository at this point in the history
* Adds --no-publish/--no option to spk-convert-pip script.

This allows the user by pass the "Do you want to also publish these
packages? [y/N]: " question, effectively pre-answering it with 'no'.

Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
  • Loading branch information
dcookspi authored May 15, 2024
1 parent 6c687b7 commit cd83051
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/spk-convert-pip/spk-convert-pip
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,18 @@ def main() -> int:
default="origin",
help="The repository to publish to. Any configured spfs repository can be named here.",
)
pip_cmd.add_argument(
group = pip_cmd.add_mutually_exclusive_group()
group.add_argument(
"--publish",
default=None,
action="store_true",
help="Also publish the packages after convert",
help="Also publish the packages after conversion. Does not ask if you want to publish, assumes yes",
)
group.add_argument(
"--no-publish",
default=None,
action="store_true",
help="Do not publish the packages after conversion. Does not ask if you want to publish, assumes no",
)
pip_cmd.add_argument(
"--force",
Expand Down Expand Up @@ -98,7 +105,7 @@ def main() -> int:
print(f" {spec.get('pkg')}")
print("")

if args.publish is None:
if args.publish is None and not args.no_publish:
print("These packages are now available in the local repository")
args.publish = bool(
input("Do you want to also publish these packages? [y/N]: ").lower()
Expand Down

0 comments on commit cd83051

Please sign in to comment.