(plan *ActionPlan)
| 23 | } |
| 24 | |
| 25 | func (c *EnableCommand) Prepare(plan *ActionPlan) (bool, error) { |
| 26 | var dependencies cwhub.Dependencies |
| 27 | |
| 28 | i := c.Item |
| 29 | |
| 30 | if c.FromLatest { |
| 31 | // we are upgrading |
| 32 | dependencies = i.LatestDependencies() |
| 33 | } else { |
| 34 | dependencies = i.CurrentDependencies() |
| 35 | } |
| 36 | |
| 37 | for sub := range dependencies.SubItems(plan.hub) { |
| 38 | if err := plan.AddCommand(NewEnableCommand(sub, c.Force)); err != nil { |
| 39 | return false, err |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | if i.State.IsInstalled() { |
| 44 | return false, nil |
| 45 | } |
| 46 | |
| 47 | return true, nil |
| 48 | } |
| 49 | |
| 50 | // CreateInstallLink creates a symlink between the actual config file at hub.HubDir and hub.ConfigDir. |
| 51 | func CreateInstallLink(i *cwhub.Item) error { |
nothing calls this directly
no test coverage detected