Adapt modules to new core module and dir structure handling

This commit is contained in:
Daniel
2019-07-31 22:36:09 +02:00
parent 7a6189143c
commit 328fc9087f
15 changed files with 122 additions and 91 deletions

View File

@@ -15,7 +15,6 @@ import (
"github.com/google/renameio"
"github.com/safing/portbase/log"
"github.com/safing/portbase/utils"
)
var (
@@ -38,13 +37,13 @@ func fetchFile(realFilepath, updateFilepath string, tries int) error {
// check destination dir
dirPath := filepath.Dir(realFilepath)
err = utils.EnsureDirectory(dirPath, 0755)
err = updateStorage.EnsureAbsPath(dirPath)
if err != nil {
return fmt.Errorf("could not create updates folder: %s", dirPath)
}
// open file for writing
atomicFile, err := renameio.TempFile(downloadTmpPath, realFilepath)
atomicFile, err := renameio.TempFile(tmpStorage.Path, realFilepath)
if err != nil {
return fmt.Errorf("could not create temp file for download: %s", err)
}