浏览代码

in case rsyncEnv is nil

z4yx 5 年之前
父节点
当前提交
ae5ff25d20
共有 2 个文件被更改,包括 6 次插入0 次删除
  1. 3 0
      worker/rsync_provider.go
  2. 3 0
      worker/two_stage_rsync_provider.go

+ 3 - 0
worker/rsync_provider.go

@@ -51,6 +51,9 @@ func newRsyncProvider(c rsyncConfig) (*rsyncProvider, error) {
 	if c.rsyncCmd == "" {
 		provider.rsyncCmd = "rsync"
 	}
+	if c.rsyncEnv == nil {
+		c.rsyncEnv = map[string]string{}
+	}
 	if c.username != "" {
 		c.rsyncEnv["USER"] = c.username
 	}

+ 3 - 0
worker/two_stage_rsync_provider.go

@@ -70,6 +70,9 @@ func newTwoStageRsyncProvider(c twoStageRsyncConfig) (*twoStageRsyncProvider, er
 		},
 	}
 
+	if c.rsyncEnv == nil {
+		c.rsyncEnv = map[string]string{}
+	}
 	if c.username != "" {
 		c.rsyncEnv["USER"] = c.username
 	}