(buildCtx context.Context)
| 41 | } |
| 42 | |
| 43 | func (c *PluginsInstalledCommand) RunContext(buildCtx context.Context) int { |
| 44 | |
| 45 | opts := plugingetter.ListInstallationsOptions{ |
| 46 | PluginDirectory: c.Meta.CoreConfig.Components.PluginConfig.PluginDirectory, |
| 47 | BinaryInstallationOptions: plugingetter.BinaryInstallationOptions{ |
| 48 | OS: runtime.GOOS, |
| 49 | ARCH: runtime.GOARCH, |
| 50 | Checksummers: []plugingetter.Checksummer{ |
| 51 | {Type: "sha256", Hash: sha256.New()}, |
| 52 | }, |
| 53 | }, |
| 54 | } |
| 55 | |
| 56 | if runtime.GOOS == "windows" && opts.Ext == "" { |
| 57 | opts.BinaryInstallationOptions.Ext = ".exe" |
| 58 | } |
| 59 | |
| 60 | log.Printf("[TRACE] init: %#v", opts) |
| 61 | |
| 62 | // a plugin requirement that matches them all |
| 63 | allPlugins := plugingetter.Requirement{ |
| 64 | Accessor: "", |
| 65 | VersionConstraints: nil, |
| 66 | Identifier: nil, |
| 67 | } |
| 68 | |
| 69 | installations, err := allPlugins.ListInstallations(opts) |
| 70 | if err != nil { |
| 71 | c.Ui.Error(err.Error()) |
| 72 | return 1 |
| 73 | } |
| 74 | |
| 75 | for _, installation := range installations { |
| 76 | c.Ui.Message(installation.BinaryPath) |
| 77 | } |
| 78 | |
| 79 | return 0 |
| 80 | } |
no test coverage detected