Skip to content

Commit

Permalink
udpate for figtree api changes
Browse files Browse the repository at this point in the history
  • Loading branch information
coryb committed Jul 28, 2018
1 parent 462ef1c commit 07ba74b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
15 changes: 9 additions & 6 deletions cmd/jira/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,19 @@ func main() {

jiracli.InitLogging()

fig := figtree.NewFigTree()
fig.EnvPrefix = "JIRA"
fig.ConfigDir = ".jira.d"

if err := os.MkdirAll(filepath.Join(jiracli.Homedir(), fig.ConfigDir), 0755); err != nil {
configDir := ".jira.d"
fig := figtree.NewFigTree(
figtree.WithHome(jiracli.Homedir()),
figtree.WithEnvPrefix("JIRA"),
figtree.WithConfigDir(configDir),
)

if err := os.MkdirAll(filepath.Join(jiracli.Homedir(), configDir), 0755); err != nil {
log.Errorf("%s", err)
panic(jiracli.Exit{Code: 1})
}

o := oreo.New().WithCookieFile(filepath.Join(jiracli.Homedir(), fig.ConfigDir, "cookies.js"))
o := oreo.New().WithCookieFile(filepath.Join(jiracli.Homedir(), configDir, "cookies.js"))

jiracmd.RegisterAllCommands()

Expand Down
6 changes: 5 additions & 1 deletion jiracli/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ func Homedir() string {
}

func findClosestParentPath(fileName string) (string, error) {
paths := figtree.FindParentPaths(fileName)
cwd, err := os.Getwd()
if err != nil {
return "", err
}
paths := figtree.FindParentPaths(Homedir(), cwd, fileName)
if len(paths) > 0 {
return paths[len(paths)-1], nil
}
Expand Down

0 comments on commit 07ba74b

Please sign in to comment.