Skip to content

Commit

Permalink
Merge pull request #48 from k1LoW/hide-real-node-count-when-unload-no…
Browse files Browse the repository at this point in the history
…des-yml

hide real nodes count when unload nodes.yml
  • Loading branch information
k1LoW committed Jan 5, 2021
2 parents 0facb6f + 3508a36 commit 3a21d84
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 15 deletions.
10 changes: 7 additions & 3 deletions cmd/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,13 @@ func newConfig() (*config.Config, error) {
if err := cfg.LoadConfigFile(detectConfigPath(configPath)); err != nil {
return nil, err
}
for _, n := range nodeLists {
if err := cfg.LoadRealNodesFile(n); err != nil {
return nil, err
if len(nodeLists) == 0 {
cfg.HideRealNodes = true
} else {
for _, n := range nodeLists {
if err := cfg.LoadRealNodesFile(n); err != nil {
return nil, err
}
}
}
if err := cfg.Build(); err != nil {
Expand Down
12 changes: 2 additions & 10 deletions cmd/draw.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,8 @@ var drawCmd = &cobra.Command{
RunE: func(cmd *cobra.Command, args []string) error {
var o output.Output

cfg := config.New()
if err := cfg.LoadConfigFile(detectConfigPath(configPath)); err != nil {
return err
}
for _, n := range nodeLists {
if err := cfg.LoadRealNodesFile(n); err != nil {
return err
}
}
if err := cfg.Build(); err != nil {
cfg, err := newConfig()
if err != nil {
return err
}

Expand Down
1 change: 0 additions & 1 deletion ndiag_ndiag.ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: ndiag アーキテクチャ
docPath: docs/arch.ja
descPath: docs/ndiag.descriptions.ja
hideLayers: true
hideRealNodes: true
hideLabelGroups: true
graph:
attrs:
Expand Down
1 change: 0 additions & 1 deletion ndiag_ndiag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: ndiag architecture
docPath: docs/arch
descPath: docs/ndiag.descriptions
hideLayers: true
hideRealNodes: true
hideLabelGroups: true
graph:
attrs:
Expand Down

0 comments on commit 3a21d84

Please sign in to comment.