(session *cliSession)
| 544 | } |
| 545 | |
| 546 | func ensureCommunityScriptsEnabled(session *cliSession) error { |
| 547 | if session == nil || session.cfg == nil { |
| 548 | return fmt.Errorf("configuration unavailable") |
| 549 | } |
| 550 | for _, id := range session.cfg.Plugins.Enabled { |
| 551 | if id == communityScriptsPluginID { |
| 552 | return nil |
| 553 | } |
| 554 | } |
| 555 | |
| 556 | return fmt.Errorf("community-scripts plugin is not enabled; add %q to plugins.enabled", communityScriptsPluginID) |
| 557 | } |
| 558 | |
| 559 | func findCommunityScript(nameOrSlug string) (core.Script, error) { |
| 560 | scripts, err := core.FetchScripts() |
no outgoing calls