mirror of
https://github.com/safing/portmaster
synced 2025-09-01 18:19:12 +00:00
Make sure main directory exists when starting updater module
This commit is contained in:
parent
5ffb637321
commit
a2b44d73ca
1 changed files with 7 additions and 0 deletions
|
@ -16,6 +16,7 @@ import (
|
|||
"github.com/safing/jess"
|
||||
"github.com/safing/portmaster/base/log"
|
||||
"github.com/safing/portmaster/base/notifications"
|
||||
"github.com/safing/portmaster/base/utils"
|
||||
"github.com/safing/portmaster/service/mgr"
|
||||
)
|
||||
|
||||
|
@ -170,6 +171,12 @@ func New(instance instance, name string, cfg Config) (*Updater, error) {
|
|||
return nil, fmt.Errorf("config is invalid: %w", err)
|
||||
}
|
||||
|
||||
// Make sure main dir exists.
|
||||
err := utils.EnsureDirectory(module.cfg.Directory, utils.PublicReadExecPermission)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("create update target directory: %s", module.cfg.DownloadDirectory)
|
||||
}
|
||||
|
||||
// Create Workers.
|
||||
module.updateCheckWorkerMgr = m.NewWorkerMgr("update checker", module.updateCheckWorker, nil)
|
||||
module.upgradeWorkerMgr = m.NewWorkerMgr("upgrader", module.upgradeWorker, nil)
|
||||
|
|
Loading…
Add table
Reference in a new issue