Example #1
0
func constructPluginInstallJSONURL(p string) (string, InstallResult) {
	repoURL := config.GaugeRepositoryUrl()
	if repoURL == "" {
		return "", installError(fmt.Errorf("Could not find gauge repository url from configuration."))
	}
	JSONURL := fmt.Sprintf("%s/%s", repoURL, p)
	if qp := plugin.QueryParams(); qp != "" {
		JSONURL += qp
	}
	return JSONURL, installSuccess("")
}
Example #2
0
func checkGaugeUpdate() []UpdateInfo {
	var updateInfos []UpdateInfo
	url := config.GaugeUpdateUrl()
	if qp := plugin.QueryParams(); qp != "" {
		url += qp
	}
	v, err := getLatestGaugeVersion(url)
	if err != nil {
		return updateInfos
	}
	latestVersion, err := version.ParseVersion(v)
	if err != nil {
		return updateInfos
	}
	isLatestVersion := version.CurrentGaugeVersion.IsLesserThan(latestVersion)
	if isLatestVersion {
		updateInfos = append(updateInfos, UpdateInfo{"Gauge", latestVersion.String(), "Download the installer from http://getgauge.io/get-started/"})
	}
	return updateInfos
}