feat: Replace cli to cobra (#1855)
* Replace cli * Replace cli * Replace cli * Format code * Add compare case * Add compare case * Add compare case * Support go style flag * Support go style flag * Add test case
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
package migrationnotes
|
||||
|
||||
import (
|
||||
"github.com/urfave/cli"
|
||||
"github.com/zeromicro/go-zero/tools/goctl/config"
|
||||
"github.com/zeromicro/go-zero/tools/goctl/util/format"
|
||||
)
|
||||
|
||||
// BeforeCommands run before comamnd run to show some migration notes
|
||||
func BeforeCommands(ctx *cli.Context) error {
|
||||
if err := migrateBefore1_3_4(ctx); err != nil {
|
||||
func BeforeCommands(dir, style string) error {
|
||||
if err := migrateBefore1_3_4(dir, style); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -4,13 +4,9 @@ import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
func migrateBefore1_3_4(ctx *cli.Context) error {
|
||||
dir := ctx.String("dir")
|
||||
style := ctx.String("style")
|
||||
func migrateBefore1_3_4(dir, style string) error {
|
||||
ok, err := needShow1_3_4(dir, style)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user