Utils: replace windows line breaks with unix breaks in deviceshell.sh

Change-Id: I6e07497370360ff04dfec66b55c2e69c0215d235
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
David Schulz
2022-10-18 08:36:17 +02:00
parent 31e24208b5
commit ef476e538f

View File

@@ -259,8 +259,11 @@ bool DeviceShell::installShellScript()
return false; return false;
} }
const static QByteArray shellScriptBase64 const static QByteArray shellScriptBase64 = FilePath(":/utils/scripts/deviceshell.sh")
= FilePath(":/utils/scripts/deviceshell.sh").fileContents().value().toBase64(); .fileContents()
.value()
.replace("\r\n", "\n")
.toBase64();
const QByteArray scriptCmd = "(scriptData=$(echo " + shellScriptBase64 const QByteArray scriptCmd = "(scriptData=$(echo " + shellScriptBase64
+ " | base64 -d 2>/dev/null ) && /bin/sh -c \"$scriptData\") || " + " | base64 -d 2>/dev/null ) && /bin/sh -c \"$scriptData\") || "
"echo ERROR_INSTALL_SCRIPT >&2\n"; "echo ERROR_INSTALL_SCRIPT >&2\n";