Skip to content
This repository was archived by the owner on Apr 1, 2024. It is now read-only.

Commit e3c01e9

Browse files
committed
use filepath.Abs
1 parent ce8b84c commit e3c01e9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/markdown/markdown.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ type Config struct {
2424
}
2525

2626
func (m *Config) Create(filename string) (*os.File, error) {
27-
dest := filepath.Join(m.BaseDir, filename)
27+
dest, err := filepath.Abs(filepath.Join(m.BaseDir, filename))
28+
if err != nil {
29+
return nil, errors.WithStack(err)
30+
}
2831
return os.Create(dest)
2932
}
3033

0 commit comments

Comments
 (0)