Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &Z.Cmd{ Name: "edit", Summary: `opens the text editor for you to edit node properties`, Commands: []*Z.Cmd{ help.Cmd, }, Call: func(cmd *Z.Cmd, args ...string) error { dStore := &store.LocalStore{Path: Z.Vars.Get(".darwin.dir")} d, err := darwin.Load( dStore, ) if err != nil { return err } node, err := search.Search(d) if err != nil { return err } yamlNode, err := yaml.Marshal(node) if err != nil { return err } prompt := &survey.Editor{ Message: "Edit the node", Default: string(yamlNode), AppendDefault: true, FileName: "*.yaml", } var answer string survey.AskOne(prompt, &answer) err = yaml.Unmarshal([]byte(answer), &node) if err != nil { return err } err = dStore.Save(node) return nil }, }
Cmd is the root command
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.