Browse Source

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

jeessy2 1 year ago
parent
commit
286a1323ef
1 changed files with 1 additions and 0 deletions
  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"
 	}