Skip to content

Commit

Permalink
revert(convert): remove convert from file subcommand (#975)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tieske authored Jul 18, 2023
1 parent 869a0c9 commit 941bca6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
10 changes: 1 addition & 9 deletions cmd/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package cmd

import (
"fmt"
"log"
"os"

"github.com/kong/deck/convert"
Expand Down Expand Up @@ -67,16 +66,9 @@ func executeConvert(_ *cobra.Command, _ []string) error {
}

// newConvertCmd represents the convert command
func newConvertCmd(deprecated bool) *cobra.Command {
func newConvertCmd() *cobra.Command {
short := "Convert files from one format into another format"
execute := executeConvert
if deprecated {
short = "[deprecated] use 'file convert' instead"
execute = func(cmd *cobra.Command, args []string) error {
log.Println("Warning: the 'deck convert' command was deprecated and moved to 'deck file convert'")
return executeConvert(cmd, args)
}
}

convertCmd := &cobra.Command{
Use: "convert",
Expand Down
3 changes: 1 addition & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ It can be used to export, import, or sync entities to Kong.`,
rootCmd.AddCommand(newPingCmd())
rootCmd.AddCommand(newDumpCmd())
rootCmd.AddCommand(newDiffCmd())
rootCmd.AddCommand(newConvertCmd(true)) // deprecated, to exist under the `file` subcommand only
rootCmd.AddCommand(newConvertCmd())
rootCmd.AddCommand(newCompletionCmd())
rootCmd.AddCommand(newKonnectCmd())
{
Expand All @@ -224,7 +224,6 @@ It can be used to export, import, or sync entities to Kong.`,
fileCmd.AddCommand(newMergeCmd())
fileCmd.AddCommand(newPatchCmd())
fileCmd.AddCommand(newOpenapi2KongCmd())
fileCmd.AddCommand(newConvertCmd(false))
}
return rootCmd
}
Expand Down

0 comments on commit 941bca6

Please sign in to comment.