Merge branch 'main' into v2
* main: fix(syncthing): ensure both config and data dirs exist at startup (fixes #10126) (#10127) fix(versioner): fix perms of created folders (fixes #9626) (#10105) refactor: use slices.Contains to simplify code (#10121)
This commit is contained in:
@@ -295,10 +295,12 @@ func (c *serveCmd) Run() error {
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure that our home directory exists.
|
||||
if err := syncthing.EnsureDir(locations.GetBaseDir(locations.ConfigBaseDir), 0o700); err != nil {
|
||||
l.Warnln("Failure on home directory:", err)
|
||||
os.Exit(svcutil.ExitError.AsInt())
|
||||
// Ensure that our config and data directories exist.
|
||||
for _, loc := range []locations.BaseDirEnum{locations.ConfigBaseDir, locations.DataBaseDir} {
|
||||
if err := syncthing.EnsureDir(locations.GetBaseDir(loc), 0o700); err != nil {
|
||||
l.Warnln("Failed to ensure directory exists:", err)
|
||||
os.Exit(svcutil.ExitError.AsInt())
|
||||
}
|
||||
}
|
||||
|
||||
if c.InternalInnerProcess {
|
||||
|
||||
Reference in New Issue
Block a user