diff --git a/pkg/cmd/cmd.go b/pkg/cmd/cmd.go index 5f52c2c8e..885881db2 100644 --- a/pkg/cmd/cmd.go +++ b/pkg/cmd/cmd.go @@ -14,8 +14,6 @@ import ( cmdinit "kusionstack.io/kusion/pkg/cmd/init" "kusionstack.io/kusion/pkg/cmd/workspace" - // we need to import compile pkg to keep the compile command available - "kusionstack.io/kusion/pkg/cmd/compile" //nolint:staticcheck "kusionstack.io/kusion/pkg/cmd/deps" "kusionstack.io/kusion/pkg/cmd/destroy" "kusionstack.io/kusion/pkg/cmd/preview" @@ -95,7 +93,6 @@ func NewKusionctlCmd(o KusionctlOptions) *cobra.Command { Commands: []*cobra.Command{ workspace.NewCmd(), cmdinit.NewCmdInit(), - compile.NewCmdCompile(), build.NewCmdBuild(), deps.NewCmdDeps(), }, diff --git a/pkg/cmd/compile/compile.go b/pkg/cmd/compile/compile.go deleted file mode 100644 index 05f26492c..000000000 --- a/pkg/cmd/compile/compile.go +++ /dev/null @@ -1,30 +0,0 @@ -// Deprecated: Use Build to generate the Intent instead. -package compile - -import ( - "fmt" - - "github.com/spf13/cobra" - "k8s.io/kubectl/pkg/util/templates" - - "kusionstack.io/kusion/pkg/cmd/util" - "kusionstack.io/kusion/pkg/util/i18n" -) - -func NewCmdCompile() *cobra.Command { - compileShort := i18n.T("Deprecated: Use 'kusion build' to generate the Intent instead") - compileExample := i18n.T("Deprecated") - - cmd := &cobra.Command{ - Use: "compile", - Short: compileShort, - Example: templates.Examples(compileExample), - Aliases: []string{"cl"}, - RunE: func(_ *cobra.Command, args []string) (err error) { - defer util.RecoverErr(&err) - util.CheckErr(fmt.Errorf("this command is deprecated. Please use `kusion build` to generate the Intent instead")) - return - }, - } - return cmd -} diff --git a/pkg/cmd/compile/compile_test.go b/pkg/cmd/compile/compile_test.go deleted file mode 100644 index 902acf0d4..000000000 --- a/pkg/cmd/compile/compile_test.go +++ /dev/null @@ -1,15 +0,0 @@ -package compile - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestNewCmdCompile(t *testing.T) { - t.Run("compile", func(t *testing.T) { - cmd := NewCmdCompile() - err := cmd.Execute() - assert.Errorf(t, err, "this command is deprecated. Please use `kusion build` to generate the Intent instead") - }) -}