mirror of
https://github.com/tuna/tunasync.git
synced 2025-06-15 14:12:47 +00:00
extra options should only be applied to the second stage
This commit is contained in:
parent
07cb51076e
commit
b25be80670
@ -458,7 +458,7 @@ exit 0
|
|||||||
fmt.Sprintf(
|
fmt.Sprintf(
|
||||||
"-aHvh --no-o --no-g --stats --exclude .~tmp~/ --safe-links "+
|
"-aHvh --no-o --no-g --stats --exclude .~tmp~/ --safe-links "+
|
||||||
"--timeout=120 --contimeout=120 --exclude dists/ -6 "+
|
"--timeout=120 --contimeout=120 --exclude dists/ -6 "+
|
||||||
"--exclude-from %s --delete-excluded --cache %s %s",
|
"--exclude-from %s %s %s",
|
||||||
provider.excludeFile, provider.upstreamURL, provider.WorkingDir(),
|
provider.excludeFile, provider.upstreamURL, provider.WorkingDir(),
|
||||||
),
|
),
|
||||||
targetDir,
|
targetDir,
|
||||||
@ -497,7 +497,7 @@ exit 0
|
|||||||
expectedOutput := fmt.Sprintf(
|
expectedOutput := fmt.Sprintf(
|
||||||
"-aHvh --no-o --no-g --stats --exclude .~tmp~/ --safe-links "+
|
"-aHvh --no-o --no-g --stats --exclude .~tmp~/ --safe-links "+
|
||||||
"--timeout=120 --contimeout=120 --exclude dists/ -6 "+
|
"--timeout=120 --contimeout=120 --exclude dists/ -6 "+
|
||||||
"--exclude-from %s --delete-excluded --cache %s %s\n",
|
"--exclude-from %s %s %s\n",
|
||||||
provider.excludeFile, provider.upstreamURL, provider.WorkingDir(),
|
provider.excludeFile, provider.upstreamURL, provider.WorkingDir(),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -106,6 +106,9 @@ func (p *twoStageRsyncProvider) Options(stage int) ([]string, error) {
|
|||||||
|
|
||||||
} else if stage == 2 {
|
} else if stage == 2 {
|
||||||
options = append(options, p.stage2Options...)
|
options = append(options, p.stage2Options...)
|
||||||
|
if p.extraOptions != nil {
|
||||||
|
options = append(options, p.extraOptions...)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return []string{}, fmt.Errorf("Invalid stage: %d", stage)
|
return []string{}, fmt.Errorf("Invalid stage: %d", stage)
|
||||||
}
|
}
|
||||||
@ -117,9 +120,6 @@ func (p *twoStageRsyncProvider) Options(stage int) ([]string, error) {
|
|||||||
if p.excludeFile != "" {
|
if p.excludeFile != "" {
|
||||||
options = append(options, "--exclude-from", p.excludeFile)
|
options = append(options, "--exclude-from", p.excludeFile)
|
||||||
}
|
}
|
||||||
if p.extraOptions != nil {
|
|
||||||
options = append(options, p.extraOptions...)
|
|
||||||
}
|
|
||||||
|
|
||||||
return options, nil
|
return options, nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user