Skip to content

Commit

Permalink
fix the cache dir permission
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex222222222222 committed Mar 16, 2023
1 parent c115fda commit bdbcd3b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func GenerateDefaultConfig() (*UserConfig, error) {
}

if _, err := os.Stat(c.CacheDir); errors.Is(err, os.ErrNotExist) {
os.MkdirAll(c.CacheDir, os.ModeDir)
os.MkdirAll(c.CacheDir, os.ModePerm)
}

return &c, nil
Expand Down
2 changes: 1 addition & 1 deletion ocr/ocr.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func ocrWithSpaceOcr(img *image.Image, c *config.UserConfig) (string, error) {

func ocrWithTesseract(img *image.Image, c *config.UserConfig) (string, error) {
if _, err := os.Stat(c.CacheDir); errors.Is(err, os.ErrNotExist) {
os.Mkdir(c.CacheDir, os.FileMode(751))
os.MkdirAll(c.CacheDir, os.ModePerm)
}

f, err := os.Create(c.CacheDir + "/tesseract.png")
Expand Down

0 comments on commit bdbcd3b

Please sign in to comment.