Skip to content

Commit

Permalink
Fix output headers and example
Browse files Browse the repository at this point in the history
Signed-off-by: Pete Wall <pwall@vmware.com>
  • Loading branch information
Pete Wall committed Jun 16, 2022
1 parent a1f6766 commit 84a1c1b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion cmd/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ var AttachMetaFileCmd = &cobra.Command{
Use: "metafile",
Short: "Attach a meta file",
Long: "Upload and attach a meta file to a product in the VMware Marketplace",
Example: fmt.Sprintf("%s attach metafile -p hyperspace-database-vm1 -v 1.2.3 --file deploy.sh", AppName),
Example: fmt.Sprintf("%s attach metafile -p hyperspace-database-vm1 -v 1.2.3 --metafile deploy.sh --metafile-type cli", AppName),
Args: cobra.NoArgs,
PreRunE: RunSerially(ValidateMetaFileType, GetRefreshToken),
RunE: func(cmd *cobra.Command, args []string) error {
Expand All @@ -229,6 +229,7 @@ var AttachMetaFileCmd = &cobra.Command{
return err
}

Output.PrintHeader(fmt.Sprintf("Assets for %s %s:", updatedProduct.DisplayName, version.Number))
return Output.RenderAssets(pkg.GetAssets(updatedProduct, version.Number))
},
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/products.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ var ListAssetsCmd = &cobra.Command{
var assets []*pkg.Asset
if AssetType == "" {
assets = pkg.GetAssets(product, version.Number)
Output.PrintHeader(fmt.Sprintf("Assets for for %s %s:", product.DisplayName, version.Number))
Output.PrintHeader(fmt.Sprintf("Assets for %s %s:", product.DisplayName, version.Number))
} else {
assetType := assetTypeMapping[AssetType]
assets = pkg.GetAssetsByType(assetType, product, version.Number)
Output.PrintHeader(fmt.Sprintf("%s assets for for %s %s:", assetType, product.DisplayName, version.Number))
Output.PrintHeader(fmt.Sprintf("%s assets for %s %s:", assetType, product.DisplayName, version.Number))
}

return Output.RenderAssets(assets)
Expand Down
6 changes: 3 additions & 3 deletions test/external/product_list_assets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var _ = Describe("product list-assets", func() {
DefineCommonSteps(define)

define.Then(`^the table of charts is printed$`, func() {
Eventually(CommandSession.Out).Should(Say("Chart assets for for NGINX Open Source Helm Chart packaged by Bitnami 1.21.1_0:"))
Eventually(CommandSession.Out).Should(Say("Chart assets for NGINX Open Source Helm Chart packaged by Bitnami 1.21.1_0:"))
Eventually(CommandSession.Out).Should(Say("NAME"))
Eventually(CommandSession.Out).Should(Say("TYPE"))
Eventually(CommandSession.Out).Should(Say("VERSION"))
Expand All @@ -62,7 +62,7 @@ var _ = Describe("product list-assets", func() {
})

define.Then(`^the table of container images is printed$`, func() {
Eventually(CommandSession.Out).Should(Say("Container Image assets for for Cloudian S3 compatible object storage for Tanzu 1.2.1:"))
Eventually(CommandSession.Out).Should(Say("Container Image assets for Cloudian S3 compatible object storage for Tanzu 1.2.1:"))
Eventually(CommandSession.Out).Should(Say("NAME"))
Eventually(CommandSession.Out).Should(Say("TYPE"))
Eventually(CommandSession.Out).Should(Say("VERSION"))
Expand All @@ -76,7 +76,7 @@ var _ = Describe("product list-assets", func() {
})

define.Then(`^the table of virtual machine files is printed$`, func() {
Eventually(CommandSession.Out).Should(Say("VM assets for for NGINX Open Source Virtual Appliance packaged by Bitnami 1.21.0_1:"))
Eventually(CommandSession.Out).Should(Say("VM assets for NGINX Open Source Virtual Appliance packaged by Bitnami 1.21.0_1:"))
Eventually(CommandSession.Out).Should(Say("NAME"))
Eventually(CommandSession.Out).Should(Say("TYPE"))
Eventually(CommandSession.Out).Should(Say("VERSION"))
Expand Down

0 comments on commit 84a1c1b

Please sign in to comment.