@@ -157,6 +157,10 @@ It can be used for backup and capture Gitea server image to send to maintainer`,
157
157
Name : "skip-log, L" ,
158
158
Usage : "Skip the log dumping" ,
159
159
},
160
+ cli.BoolFlag {
161
+ Name : "skip-custom-dir" ,
162
+ Usage : "Skip custom directory" ,
163
+ },
160
164
cli.GenericFlag {
161
165
Name : "type" ,
162
166
Value : outputTypeEnum ,
@@ -297,17 +301,21 @@ func runDump(ctx *cli.Context) error {
297
301
}
298
302
}
299
303
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 )
305
315
}
306
316
} 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 )
308
318
}
309
- } else {
310
- log .Info ("Custom dir %s doesn't exist, skipped" , setting .CustomPath )
311
319
}
312
320
313
321
isExist , err := util .IsExist (setting .AppDataPath )
0 commit comments