Esempio n. 1
0
func GetPluginsInfo() []common.Plugin {
	allPluginsWithVersion, err := common.GetAllInstalledPluginsWithVersion()
	if err != nil {
		logger.Log.Info("No plugins found")
		logger.Log.Info("Plugins can be installed with `gauge --install {plugin-name}`")
		os.Exit(0)
	}
	return allPluginsWithVersion
}
Esempio n. 2
0
func PrintVersion() {
	fmt.Printf("Gauge version: %s\n\n", CurrentGaugeVersion.String())
	fmt.Println("Plugins\n-------")
	allPluginsWithVersion, err := common.GetAllInstalledPluginsWithVersion()
	if err != nil {
		fmt.Println("No plugins found")
		fmt.Println("Plugins can be installed with `gauge --install {plugin-name}`")
		os.Exit(0)
	}
	for _, pluginInfo := range allPluginsWithVersion {
		fmt.Printf("%s (%s)\n", pluginInfo.Name, pluginInfo.Version.String())
	}
}
Esempio n. 3
0
func checkPluginUpdates() []UpdateInfo {
	pluginsToUpdate := make([]UpdateInfo, 0)
	plugins, err := common.GetAllInstalledPluginsWithVersion()
	if err != nil {
		return pluginsToUpdate
	}
	for _, plugin := range plugins {
		desc, result := getInstallDescription(plugin.Name)
		if result.Error != nil {
			continue
		}
		pluginsToUpdate = append(pluginsToUpdate, createPluginUpdateDetail(plugin.Version.String(), *desc)...)
	}
	return pluginsToUpdate
}