✨ Use dot as folder separator
Also don't add dot if no extension
This commit is contained in:
parent
0687671c7d
commit
a61af1b4b3
4 changed files with 74 additions and 4 deletions
|
|
@ -16,7 +16,14 @@ func Append(l models.Log) error {
|
|||
return err
|
||||
}
|
||||
|
||||
filename := fmt.Sprintf("%s.%s", strings.ReplaceAll(l.Name, ".", string(os.PathSeparator)), conf.Input.Ext)
|
||||
filename := l.Name
|
||||
if conf.Input.DotFolder {
|
||||
filename = strings.ReplaceAll(filename, ".", string(os.PathSeparator))
|
||||
}
|
||||
|
||||
if conf.Input.Ext != "" {
|
||||
filename = fmt.Sprintf("%s.%s", filename, conf.Input.Ext)
|
||||
}
|
||||
path := fp.Join(conf.Input.Path, filename)
|
||||
dir := fp.Dir(path)
|
||||
err = os.MkdirAll(dir, 0750)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue