Skip to content

Commit

Permalink
update fate
Browse files Browse the repository at this point in the history
  • Loading branch information
godcong committed Feb 5, 2020
1 parent 3bf9859 commit f5c43a8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions cmd/console/name.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,18 @@ func cmdName() *cobra.Command {
Use: "name",
Short: "output the name",
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("config will output to %s/config.json\n", path)
config.DefaultJSONPath = path
cfg := config.LoadConfig()
fmt.Printf("config loaded: %+v", cfg)
bornTime, e := time.Parse(chronos.DateFormat, born)
if e != nil {
return
log.Fatalw("parseborn", "error", e)
}
f := fate.NewFate(last, bornTime, fate.ConfigOption(cfg), fate.SexOption(fate.Sex(sex)))

e = f.MakeName(context.Background())
if e != nil {
log.Errorw("makename", "error", e)
return
log.Fatalw("makename", "error", e)
}
},
}
Expand Down
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ func DefaultConfig() *Config {
return &Config{
RunInit: false,
FilterMode: 0,
StrokeMax: 3,
StrokeMin: 18,
StrokeMax: 18,
StrokeMin: 3,
HardFilter: false,
FixBazi: false,
SupplyFilter: true,
Expand Down
2 changes: 1 addition & 1 deletion fate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func init() {
}

func TestFate_RunMakeName(t *testing.T) {
born := chronos.New("2020/01/14 02:45").Solar().Time()
born := chronos.New("2020/02/06 15:45").Solar().Time()
last := "张"
cfg := config.DefaultConfig()
cfg.BaguaFilter = true
Expand Down

0 comments on commit f5c43a8

Please sign in to comment.