Fix bug with filepath

This commit is contained in:
James Mills 2023-08-20 01:02:33 +10:00
parent b6add700a3
commit 90177a39bc
No known key found for this signature in database
GPG Key ID: AC4C014F1440EBD6

View File

@ -79,12 +79,12 @@ func (c *Client) Open(user, path string) (fs.File, error) {
} }
} }
res, err := c.getRawFileOrLFS(user, repo, path, defaultPagesRef) res, err := c.getRawFileOrLFS(user, repo, filepath, defaultPagesRef)
if err != nil { if err != nil {
return nil, err return nil, err
} }
if strings.HasSuffix(path, ".md") { if strings.HasSuffix(filepath, ".md") {
res, err = handleMD(res) res, err = handleMD(res)
if err != nil { if err != nil {
return nil, err return nil, err
@ -93,7 +93,7 @@ func (c *Client) Open(user, path string) (fs.File, error) {
return &openFile{ return &openFile{
content: res, content: res,
name: path, name: filepath,
}, nil }, nil
} }