mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	@@ -17,6 +17,7 @@ import (
 | 
			
		||||
	"code.gitea.io/gitea/models"
 | 
			
		||||
	"code.gitea.io/gitea/modules/setting"
 | 
			
		||||
	"github.com/Unknwon/cae/zip"
 | 
			
		||||
	"github.com/Unknwon/com"
 | 
			
		||||
	"github.com/urfave/cli"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
@@ -100,7 +101,9 @@ func runDump(ctx *cli.Context) error {
 | 
			
		||||
		log.Printf("Custom dir %s doesn't exist, skipped", setting.CustomPath)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if com.IsExist(setting.AppDataPath) {
 | 
			
		||||
		log.Printf("Packing data directory...%s", setting.AppDataPath)
 | 
			
		||||
 | 
			
		||||
		var sessionAbsPath string
 | 
			
		||||
		if setting.SessionConfig.Provider == "file" {
 | 
			
		||||
			if len(setting.SessionConfig.ProviderConfig) == 0 {
 | 
			
		||||
@@ -108,9 +111,9 @@ func runDump(ctx *cli.Context) error {
 | 
			
		||||
			}
 | 
			
		||||
			sessionAbsPath, _ = filepath.Abs(setting.SessionConfig.ProviderConfig)
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if err := zipAddDirectoryExclude(z, "data", setting.AppDataPath, sessionAbsPath); err != nil {
 | 
			
		||||
		log.Fatalf("Fail to include data directory: %v", err)
 | 
			
		||||
			log.Fatalf("Failed to include data directory: %v", err)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if err := z.AddDir("log", setting.LogRootPath); err != nil {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user