global-functions: introduce $Dos2Unix

This commit is contained in:
Christian Hesse 2023-02-13 10:14:11 +01:00
parent 7d3c4738d0
commit d54c46ab98

View file

@ -25,6 +25,7 @@
:global CharacterReplace;
:global CleanFilePath;
:global DeviceInfo;
:global Dos2Unix;
:global DownloadPackage;
:global EitherOr;
:global EscapeForRegEx;
@ -226,6 +227,15 @@
"\n Version: " . $ExpectedConfigVersion);
}
# convert line endings, DOS -> UNIX
:set Dos2Unix do={
:local Input [ :tostr $1 ];
:global CharacterReplace;
:return [ $CharacterReplace $Input ("\r\n") ("\n") ];
}
# download package from upgrade server
:set DownloadPackage do={
:local PkgName [ :tostr $1 ];