Quellcode durchsuchen

restore: create data directory before restoring data files (#4413)

Unknwon vor 7 Jahren
Ursprung
Commit
1af01f5e30
1 geänderte Dateien mit 1 neuen und 0 gelöschten Zeilen
  1. 1 0
      cmd/restore.go

+ 1 - 0
cmd/restore.go

@@ -101,6 +101,7 @@ func runRestore(c *cli.Context) error {
 
 
 	// Data files
 	// Data files
 	if !c.Bool("database-only") {
 	if !c.Bool("database-only") {
+		os.MkdirAll(setting.AppDataPath, os.ModePerm)
 		for _, dir := range []string{"attachments", "avatars"} {
 		for _, dir := range []string{"attachments", "avatars"} {
 			dirPath := path.Join(setting.AppDataPath, dir)
 			dirPath := path.Join(setting.AppDataPath, dir)
 			if com.IsExist(dirPath) {
 			if com.IsExist(dirPath) {