mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
feat(actions): watch dir create folder if not exists (#351)
* create folder on watch dir action
This commit is contained in:
parent
7eefeb54c1
commit
b4589243de
1 changed files with 6 additions and 0 deletions
|
@ -156,6 +156,12 @@ func (s *service) watchFolder(action domain.Action, release domain.Release) erro
|
||||||
_, tmpFileName := path.Split(release.TorrentTmpFile)
|
_, tmpFileName := path.Split(release.TorrentTmpFile)
|
||||||
fullFileName := path.Join(watchFolderArgs, tmpFileName+".torrent")
|
fullFileName := path.Join(watchFolderArgs, tmpFileName+".torrent")
|
||||||
|
|
||||||
|
// Create folder
|
||||||
|
err = os.MkdirAll(watchFolderArgs, os.ModePerm)
|
||||||
|
if err != nil {
|
||||||
|
return errors.Wrap(err, "could not create new folders %v", fullFileName)
|
||||||
|
}
|
||||||
|
|
||||||
// Create new file
|
// Create new file
|
||||||
newFile, err := os.Create(fullFileName)
|
newFile, err := os.Create(fullFileName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue