From 1a031bb212a12b7c13c4571011a627bf184e6b10 Mon Sep 17 00:00:00 2001 From: rawlingsj Date: Fri, 25 May 2018 16:07:45 +0100 Subject: [PATCH] try a fix for setting the GIT_ASKPASS envvar --- main.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 2342cd70..5543bdb1 100644 --- a/main.go +++ b/main.go @@ -3,22 +3,24 @@ package main import ( "errors" "fmt" - "github.com/coreos/go-semver/semver" - "github.com/google/go-github/github" - version "github.com/hashicorp/go-version" "io/ioutil" "os" "strings" + "github.com/coreos/go-semver/semver" + "github.com/google/go-github/github" + version "github.com/hashicorp/go-version" + "bufio" "context" "encoding/xml" "flag" - "golang.org/x/oauth2" "os/exec" "path/filepath" "regexp" "sort" + + "golang.org/x/oauth2" ) type Project struct { @@ -164,6 +166,7 @@ func getLatestTag(c config) (string, error) { return "", errors.New(fmt.Sprint("error running git: %v", err)) } cmd := exec.Command("git", "fetch", "--tags", "-v") + cmd.Env = append(cmd.Env, "GIT_ASKPASS="+os.Getenv("GIT_ASKPASS")) err = cmd.Run() if err != nil { return "", errors.New(fmt.Sprint("error fetching tags: %v", err))