@@ -157,6 +157,10 @@ It can be used for backup and capture Gitea server image to send to maintainer`,
157157 Name : "skip-log, L" ,
158158 Usage : "Skip the log dumping" ,
159159 },
160+ cli.BoolFlag {
161+ Name : "skip-custom-dir" ,
162+ Usage : "Skip custom directory" ,
163+ },
160164 cli.GenericFlag {
161165 Name : "type" ,
162166 Value : outputTypeEnum ,
@@ -297,17 +301,21 @@ func runDump(ctx *cli.Context) error {
297301 }
298302 }
299303
300- customDir , err := os .Stat (setting .CustomPath )
301- if err == nil && customDir .IsDir () {
302- if is , _ := isSubdir (setting .AppDataPath , setting .CustomPath ); ! is {
303- if err := addRecursiveExclude (w , "custom" , setting .CustomPath , []string {absFileName }, verbose ); err != nil {
304- fatal ("Failed to include custom: %v" , err )
304+ if ctx .IsSet ("skip-custom-dir" ) && ctx .Bool ("skip-custom-dir" ) {
305+ log .Info ("Skiping custom directory" )
306+ } else {
307+ customDir , err := os .Stat (setting .CustomPath )
308+ if err == nil && customDir .IsDir () {
309+ if is , _ := isSubdir (setting .AppDataPath , setting .CustomPath ); ! is {
310+ if err := addRecursiveExclude (w , "custom" , setting .CustomPath , []string {absFileName }, verbose ); err != nil {
311+ fatal ("Failed to include custom: %v" , err )
312+ }
313+ } else {
314+ log .Info ("Custom dir %s is inside data dir %s, skipped" , setting .CustomPath , setting .AppDataPath )
305315 }
306316 } else {
307- log .Info ("Custom dir %s is inside data dir %s , skipped" , setting .CustomPath , setting . AppDataPath )
317+ log .Info ("Custom dir %s doesn't exist , skipped" , setting .CustomPath )
308318 }
309- } else {
310- log .Info ("Custom dir %s doesn't exist, skipped" , setting .CustomPath )
311319 }
312320
313321 isExist , err := util .IsExist (setting .AppDataPath )
0 commit comments