From ef476e538f8be912574425ae2777153961e9be5d Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 18 Oct 2022 08:36:17 +0200 Subject: [PATCH] Utils: replace windows line breaks with unix breaks in deviceshell.sh Change-Id: I6e07497370360ff04dfec66b55c2e69c0215d235 Reviewed-by: hjk --- src/libs/utils/deviceshell.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libs/utils/deviceshell.cpp b/src/libs/utils/deviceshell.cpp index b3133a66c14..9dc4633e957 100644 --- a/src/libs/utils/deviceshell.cpp +++ b/src/libs/utils/deviceshell.cpp @@ -259,8 +259,11 @@ bool DeviceShell::installShellScript() return false; } - const static QByteArray shellScriptBase64 - = FilePath(":/utils/scripts/deviceshell.sh").fileContents().value().toBase64(); + const static QByteArray shellScriptBase64 = FilePath(":/utils/scripts/deviceshell.sh") + .fileContents() + .value() + .replace("\r\n", "\n") + .toBase64(); const QByteArray scriptCmd = "(scriptData=$(echo " + shellScriptBase64 + " | base64 -d 2>/dev/null ) && /bin/sh -c \"$scriptData\") || " "echo ERROR_INSTALL_SCRIPT >&2\n";