Pull request: all: use renameio instead of golibs/file
Merge in DNS/adguard-home from use-renameio to master Squashed commit of the following: commit 807cda37b0e9e49539c1a8ce7912b74bd3c05b08 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Apr 6 19:54:21 2021 +0300 all: use renameio instead of golibs/file
This commit is contained in:
@@ -7,8 +7,8 @@ import (
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
|
||||
"github.com/AdguardTeam/golibs/file"
|
||||
"github.com/AdguardTeam/golibs/log"
|
||||
"github.com/google/renameio/maybe"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
yaml "gopkg.in/yaml.v2"
|
||||
)
|
||||
@@ -99,7 +99,7 @@ func upgradeConfigSchema(oldVersion int, diskConf yobj) (err error) {
|
||||
|
||||
config.fileData = body
|
||||
confFile := config.getConfigFilename()
|
||||
err = file.SafeWrite(confFile, body)
|
||||
err = maybe.WriteFile(confFile, body, 0o644)
|
||||
if err != nil {
|
||||
return fmt.Errorf("saving new config: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user