Skip to content

Commit

Permalink
Fixing cache file path dependency on working directory
Browse files Browse the repository at this point in the history
  • Loading branch information
shivas committed Sep 9, 2021
1 parent 7f00819 commit 6b8d525
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tasks:
install-deps:
desc: Install dependencies needed to build release
cmds:
- go get github.com/gonutz/rsrc
- go install github.com/gonutz/rsrc@latest
silent: true

resources:
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ github.com/disintegration/gift v1.2.1/go.mod h1:Jh2i7f7Q2BM7Ezno3PhfezbR1xpUg9dU
github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1ei82L+c=
github.com/disintegration/imaging v1.6.2/go.mod h1:44/5580QXChDfwIclfc/PCwrr44amcmDAg8hxG0Ewe4=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/gonutz/rsrc v0.0.0-20180911104558-96f130112cb1 h1:JBZIm+g0SvPFkGCPmy56YuEbiOXGHcOJpXTlW+4Pj+E=
github.com/gonutz/rsrc v0.0.0-20180911104558-96f130112cb1/go.mod h1:RlfulN6lLdBnR7EiTZBlgS0sD4Uv07qQHaxvNlVj/1A=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2 h1:acNfDZXmm28D2Yg/c3ALnZStzNaZMSagpbr96vY6Zjc=
Expand Down
13 changes: 3 additions & 10 deletions internal/charmanager/charmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"net/http"
"os"
"path"
"path/filepath"
"sync"

"github.com/lxn/walk"
Expand Down Expand Up @@ -83,11 +84,7 @@ func (c *CharManager) PersistCache() error {

var err error

wd, err := os.Getwd()
if err != nil {
return err
}

wd := filepath.Dir(os.Args[0])
file := path.Join(wd, cacheFileName)

var cache CharacterCache
Expand Down Expand Up @@ -119,11 +116,7 @@ func (c *CharManager) LoadCache() error {

var err error

wd, err := os.Getwd()
if err != nil {
return err
}

wd := filepath.Dir(os.Args[0])
file := path.Join(wd, cacheFileName)

f, err := os.Open(file)
Expand Down

0 comments on commit 6b8d525

Please sign in to comment.