Skip to content

Commit

Permalink
align prompts
Browse files Browse the repository at this point in the history
Signed-off-by: Billy Zha <[email protected]>
  • Loading branch information
qweeah committed Nov 30, 2023
1 parent a20aa92 commit baa8a3c
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions cmd/oras/root/index/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,16 @@ func createManifest(ctx context.Context, opts createOptions) error {
return nil
}

const (
promptExists = "Exists "
promptCopying = "Copying "
promptCopied = "Copied "
promptSkipped = "Skipped "
promptMounted = "Mouned "
promptUploading = "Uploading"
promptUploaded = "Uploaded "
)

func doCopy(ctx context.Context, dst oras.GraphTarget, destOpts createOptions, logger logrus.FieldLogger) ([]ocispec.Descriptor, error) {
// Prepare dest target
dstAsRemote, dstIsRemote := dst.(*remote.Repository)
Expand All @@ -130,13 +140,6 @@ func doCopy(ctx context.Context, dst oras.GraphTarget, destOpts createOptions, l
baseCopyOptions.FindPredecessors = func(ctx context.Context, src content.ReadOnlyGraphStorage, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
return graph.Referrers(ctx, src, desc, "")
}
const (
promptExists = "Exists "
promptCopying = "Copying"
promptCopied = "Copied "
promptSkipped = "Skipped"
promptMounted = "Mouned "
)
var onMounted func(context.Context, ocispec.Descriptor) error
if destOpts.TTY == nil {
// none TTY output
Expand Down Expand Up @@ -260,10 +263,6 @@ func doPack(ctx context.Context, t oras.Target, manifests []ocispec.Descriptor,
Size: int64(len(content)),
}

const (
promptUploading = "Uploading"
promptUploaded = "Uploaded "
)
if opts.TTY == nil {
// none TTY output
if err := display.PrintStatus(desc, promptUploading, opts.Verbose); err != nil {
Expand Down

0 comments on commit baa8a3c

Please sign in to comment.