Skip to content

Commit

Permalink
set GPG_TTY in .bashrc
Browse files Browse the repository at this point in the history
  • Loading branch information
coryb committed Dec 20, 2016
1 parent 23faa6f commit b1e552f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ if [ ! -f $HOME/.gpg-agent-info ]; then
fi
. $HOME/.gpg-agent-info
export GPG_AGENT_INFO
export GPG_TTY=$(tty)
```


Expand Down
4 changes: 4 additions & 0 deletions password.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ func (c *Cli) GetPass(user string) string {
}

func (c *Cli) SetPass(user, passwd string) error {
log.Debugf("SetPass called: %s => %s", user, passwd)
if source, ok := c.opts["password-source"].(string); ok {
log.Debugf("password-source: %s", source)
if source == "keyring" {
// save password in keychain so that it can be used for subsequent http requests
err := keyring.Set("go-jira", user, passwd)
Expand All @@ -52,7 +54,9 @@ func (c *Cli) SetPass(user, passwd string) error {
return err
}
} else if source == "pass" {
log.Debugf("processing %s", source)
if bin, err := exec.LookPath("pass"); err == nil {
log.Debugf("using %s", bin)
in := bytes.NewBufferString(fmt.Sprintf("%s\n%s\n", passwd, passwd))
out := bytes.NewBufferString("")
cmd := exec.Command(bin, "insert", "--force", fmt.Sprintf("GoJira/%s", user))
Expand Down

0 comments on commit b1e552f

Please sign in to comment.