mirror of
https://github.com/Threnklyn/jira.git
synced 2026-06-07 13:33:32 +02:00
Fixes #32 - make path to cookieFile if it's not present
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.
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"path"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@@ -87,6 +88,7 @@ func (c *Cli) saveCookies(cookies []*http.Cookie) {
|
|||||||
}
|
}
|
||||||
jsonWrite(c.cookieFile, mergedCookies)
|
jsonWrite(c.cookieFile, mergedCookies)
|
||||||
} else {
|
} else {
|
||||||
|
mkdir(path.Dir(c.cookieFile))
|
||||||
jsonWrite(c.cookieFile, cookies)
|
jsonWrite(c.cookieFile, cookies)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user