瀏覽代碼

fix: linux shell should be replace \r\n to \n (#97)

jeessy2 1 年之前
父節點
當前提交
286a1323ef
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      client/backup.go

+ 1 - 0
client/backup.go

@@ -176,6 +176,7 @@ func backup(backupConf entity.BackupConfig, encryptKey string, s3Conf entity.S3C
 	if runtime.GOOS == "windows" {
 		shellName = time.Now().Format("shell-"+util.FileNameFormatStr+"-") + "backup.bat"
 	} else {
+		shellString = strings.ReplaceAll(shellString, "\r\n", "\n") // windows to linux
 		shellName = time.Now().Format("shell-"+util.FileNameFormatStr+"-") + "backup.sh"
 	}