fix misuse of variables

This commit is contained in:
zyx 2020-03-16 21:59:30 +08:00
parent b490c22984
commit 9eb72c5db0
2 changed files with 6 additions and 6 deletions

View File

@ -52,13 +52,13 @@ func newRsyncProvider(c rsyncConfig) (*rsyncProvider, error) {
provider.rsyncCmd = "rsync" provider.rsyncCmd = "rsync"
} }
if c.rsyncEnv == nil { if c.rsyncEnv == nil {
c.rsyncEnv = map[string]string{} provider.rsyncEnv = map[string]string{}
} }
if c.username != "" { if c.username != "" {
c.rsyncEnv["USER"] = c.username provider.rsyncEnv["USER"] = c.username
} }
if c.password != "" { if c.password != "" {
c.rsyncEnv["RSYNC_PASSWORD"] = c.password provider.rsyncEnv["RSYNC_PASSWORD"] = c.password
} }
options := []string{ options := []string{

View File

@ -71,13 +71,13 @@ func newTwoStageRsyncProvider(c twoStageRsyncConfig) (*twoStageRsyncProvider, er
} }
if c.rsyncEnv == nil { if c.rsyncEnv == nil {
c.rsyncEnv = map[string]string{} provider.rsyncEnv = map[string]string{}
} }
if c.username != "" { if c.username != "" {
c.rsyncEnv["USER"] = c.username provider.rsyncEnv["USER"] = c.username
} }
if c.password != "" { if c.password != "" {
c.rsyncEnv["RSYNC_PASSWORD"] = c.password provider.rsyncEnv["RSYNC_PASSWORD"] = c.password
} }
if c.rsyncCmd == "" { if c.rsyncCmd == "" {
provider.rsyncCmd = "rsync" provider.rsyncCmd = "rsync"