Skip to content

Commit

Permalink
Fixes #32 - make path to cookieFile if it's not present
Browse files Browse the repository at this point in the history
TL;DR, this ensures ~/jira.d is present, with 0755 perms.

If ~/jira.d isn't present, we can't write to the cookieFile, which
breaks CmdLogin. This is particularly an issue when using /etc/go-jira.yml
to get an entire team using go-jira easily :)

This fixes this by ensuring the cookieFile dir is present before
writing to it.
  • Loading branch information
Mike Pountney committed Jan 29, 2016
1 parent 8190ad9 commit 6644579
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"net/url"
"os"
"os/exec"
"path"
"runtime"
"strings"
"time"
Expand Down Expand Up @@ -87,6 +88,7 @@ func (c *Cli) saveCookies(cookies []*http.Cookie) {
}
jsonWrite(c.cookieFile, mergedCookies)
} else {
mkdir(path.Dir(c.cookieFile))
jsonWrite(c.cookieFile, cookies)
}
}
Expand Down

0 comments on commit 6644579

Please sign in to comment.