Skip to content

Commit bda37d7

Browse files
committed
copy: add slug_perm to output
When using the copy command to copy packages between repositories, the unique ID (slug_perm) of the package wasn't being printed to stdout. As with other commands (such as 'push') which did, the output of this could then be parsed to further operate on the specific package. Therefore, make the output from 'copy' behave in the same way.
1 parent c335645 commit bda37d7

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

cloudsmith_cli/cli/commands/copy.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,27 +58,28 @@ def copy(
5858
"""
5959
owner, source, slug = owner_repo_package
6060

61-
click.echo(
62-
"Copying %(slug)s package from %(source)s to %(dest)s ... "
63-
% {
64-
"slug": click.style(slug, bold=True),
65-
"source": click.style(source, bold=True),
66-
"dest": click.style(destination, bold=True),
67-
},
68-
nl=False,
69-
)
70-
7161
context_msg = "Failed to copy package!"
7262
with handle_api_exceptions(
7363
ctx, opts=opts, context_msg=context_msg, reraise_on_error=skip_errors
7464
):
7565
with maybe_spinner(opts):
76-
_, new_slug = copy_package(
66+
slug_perm, new_slug = copy_package(
7767
owner=owner, repo=source, identifier=slug, destination=destination
7868
)
7969

8070
click.secho("OK", fg="green")
8171

72+
click.echo(
73+
"Copying %(slug)s package from %(source)s to %(dest)s (%(slug_perm)s)... "
74+
% {
75+
"slug": click.style(slug, bold=True),
76+
"source": click.style(source, bold=True),
77+
"dest": click.style(destination, bold=True),
78+
"slug_perm": click.style(slug_perm, bold=True),
79+
},
80+
nl=False,
81+
)
82+
8283
if no_wait_for_sync:
8384
return
8485

0 commit comments

Comments
 (0)