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

@@ -9,7 +9,6 @@ import (
"runtime"
"github.com/safing/portbase/log"
"github.com/safing/portbase/utils"
)
// Errors
@@ -75,7 +74,7 @@ func loadOrFetchFile(identifier string, fetch bool) (*File, error) {
}
// build final filepath
realFilePath := filepath.Join(updateStoragePath, filepath.FromSlash(versionedFilePath))
realFilePath := filepath.Join(updateStorage.Path, filepath.FromSlash(versionedFilePath))
if _, err := os.Stat(realFilePath); err == nil {
// file exists
updateUsedStatus(identifier, version)
@@ -83,7 +82,7 @@ func loadOrFetchFile(identifier string, fetch bool) (*File, error) {
}
// check download dir
err := utils.EnsureDirectory(downloadTmpPath, 0700)
err := tmpStorage.Ensure()
if err != nil {
return nil, fmt.Errorf("could not prepare tmp directory for download: %s", err)
}