Wizard: handle dos scripts in first boot

Scripts in which lines are terminated by CRLF break the first boot
service, so let's make sure the line termination is correct.
This commit is contained in:
Sanne Raymaekers 2024-11-12 09:52:40 +01:00 committed by Klara Simickova
parent ba9546193e
commit 7b365dcb4d
3 changed files with 38 additions and 2 deletions

View file

@ -73,7 +73,10 @@ const FirstBootStep = () => {
isCopyEnabled
isLanguageLabelVisible
language={language}
onCodeChange={(code) => dispatch(setFirstBootScript(code))}
onCodeChange={(code) => {
// In case the user is on windows
dispatch(setFirstBootScript(code.replace('\r\n', '\n')));
}}
code={selectedScript}
height="35vh"
emptyStateButton={<span data-testid="firstboot_browse">Browse</span>}