mirror of
https://github.com/safing/portbase
synced 2025-09-12 16:19:50 +00:00
Add util function for creating/checking dirs
This commit is contained in:
parent
13e64209a6
commit
0de310503a
4 changed files with 51 additions and 35 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/safing/portbase/utils"
|
||||
"github.com/tevino/abool"
|
||||
)
|
||||
|
||||
|
@ -28,7 +29,7 @@ func SetLocation(location string) (ok bool) {
|
|||
func Initialize() error {
|
||||
if initialized.SetToIf(false, true) {
|
||||
|
||||
err := ensureDirectory(rootDir, 0755)
|
||||
err := utils.EnsureDirectory(rootDir, 0755)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not create/open database directory (%s): %s", rootDir, err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue