示例#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
}
示例#2
0
文件: version.go 项目: adiferd/gauge
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())
	}
}
示例#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
}