func normalizeRepo(repo string) string {
	repo = strings.TrimPrefix(repo, "https://github.com/")
	repo = strings.TrimPrefix(repo, "http://github.com/")
	repo = strings.TrimPrefix(repo, "github.com/")
	repo = strings.Trim(repo, "/")
	return repo
}
returns the owner/name repo from input

see https://github.com/goreleaser/godownloader/issues/55
package main
import (
	"bytes"
	"fmt"
	"io/ioutil"
	"net/http"
	"os"
	"path"
	"strings"
	"text/template"
	"time"
	"github.com/apex/log"
	"github.com/apex/log/handlers/cli"
	"github.com/client9/codegen/shell"
	"github.com/goreleaser/goreleaser/pkg/config"
	"github.com/goreleaser/goreleaser/pkg/context"
	"github.com/goreleaser/goreleaser/pkg/defaults"
	"github.com/pkg/errors"
	kingpin "gopkg.in/alecthomas/kingpin.v2"
)
var (
	version = "dev"
	commit  = "none"
	datestr = "unknown"
)
func makeShell(tplsrc string, cfg *config.Project) ([]byte, error) {
	funcMap := template.FuncMap{
		"join":             strings.Join,
		"platformBinaries": makePlatformBinaries,
		"timestamp": func() string {
			return time.Now().UTC().Format(time.RFC3339)
		},
		"replace": strings.ReplaceAll,
		"time": func(s string) string {
			return time.Now().UTC().Format(s)
		},
		"tolower": strings.ToLower,
		"toupper": strings.ToUpper,
		"trim":    strings.TrimSpace,
	}
	out := bytes.Buffer{}
	t, err := template.New("shell").Funcs(funcMap).Parse(tplsrc)
	if err != nil {
		return nil, err
	}
	err = t.Execute(&out, cfg)
	return out.Bytes(), err
}
func makePlatform(goos, goarch, goarm string) string {
	platform := goos + "/" + goarch
	if goarch == "arm" && goarm != "" {
		platform += "v" + goarm
	}
	return platform
}
func makePlatformBinaries(cfg *config.Project) map[string][]string {
	platformBinaries := make(map[string][]string)
	for _, build := range cfg.Builds {
		ignore := make(map[string]bool)
		for _, ignoredBuild := range build.Ignore {
			platform := makePlatform(ignoredBuild.Goos, ignoredBuild.Goarch, ignoredBuild.Goarm)
			ignore[platform] = true
		}
		for _, goos := range build.Goos {
			for _, goarch := range build.Goarch {
				switch goarch {
				case "arm":
					for _, goarm := range build.Goarm {
						platform := makePlatform(goos, goarch, goarm)
						if !ignore[platform] {
							platformBinaries[platform] = append(platformBinaries[platform], build.Binary)
						}
					}
				default:
					platform := makePlatform(goos, goarch, "")
					if !ignore[platform] {
						platformBinaries[platform] = append(platformBinaries[platform], build.Binary)
					}
				}
			}
		}
	}
	return platformBinaries
}
func makeName(prefix, target string) (string, error) {
	armversion := "{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
	target = strings.Replace(target, armversion, "{{ .Arch }}", -1)
	armversion = "{{ .Arch }}{{ if .Arm }}{{ .Arm }}{{ end }}"
	target = strings.Replace(target, armversion, "{{ .Arch }}", -1)
	target = strings.Replace(target, "{{.Arm}}", "{{ .Arch }}", -1)
	target = strings.Replace(target, "{{ .Arm }}", "{{ .Arch }}", -1)
	if strings.Contains(target, "{{ if") ||
		strings.Contains(target, "{{if") {
		return "", fmt.Errorf("name_template %q contains unknown conditional or ARM format. Please file bug at https://github.com/goreleaser/godownloader", target)
	}
	varmap := map[string]string{
		"Os":          "${OS}",
		"Arch":        "${ARCH}",
		"Version":     "${VERSION}",
		"Tag":         "${TAG}",
		"Binary":      "${BINARY}",
		"ProjectName": "${PROJECT_NAME}",
	}
	out := bytes.Buffer{}
	if _, err := out.WriteString(prefix); err != nil {
		return "", err
	}
	t, err := template.New("name").Parse(target)
	if err != nil {
		return "", err
	}
	err = t.Execute(&out, varmap)
	return out.String(), err
}