Skip to content

Commit 2681a83

Browse files
committed
add rsync --exclude-from option
1 parent 827d57d commit 2681a83

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.vscode

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
Repository contains some helpful tools:
77
- raw rsync wrapper
8-
- rsync task — wrapper which provide important information about rsync task: progress, remain items, total items and speed
8+
- rsync task — wrapper which provide important information about rsync task: progress, remain items, total items and speed
99

1010
## Task wrapper usage
1111

rsync.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ type RsyncOptions struct {
187187
Info string
188188
// Exclude --exclude="", exclude remote paths.
189189
Exclude []string
190+
// ExcludeFrom --exclude-from="", read exclude patterns from FILE
191+
ExcludeFrom string
190192
// Include --include="", include remote paths.
191193
Include []string
192194
// Filter --filter="", include filter rule.
@@ -597,6 +599,10 @@ func getArguments(options RsyncOptions) []string {
597599
}
598600
}
599601

602+
if options.ExcludeFrom != "" {
603+
arguments = append(arguments, fmt.Sprintf("--exclude-from=%s", options.ExcludeFrom))
604+
}
605+
600606
if options.Filter != "" {
601607
arguments = append(arguments, fmt.Sprintf("--filter=%s", options.Filter))
602608
}

0 commit comments

Comments
 (0)