diff options
author | Christian Hesse <mail@eworm.de> | 2023-02-13 10:14:11 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2023-02-13 10:36:56 +0100 |
commit | d54c46ab98224c51675e74846362e80cb5f9102b (patch) | |
tree | b17b57f2f588b6da4fd0af5aa08bf993ad178763 | |
parent | 7d3c4738d07e040cbe3c293ef0b2be04631290eb (diff) |
global-functions: introduce $Dos2Unix
-rw-r--r-- | global-functions | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/global-functions b/global-functions index 84c7ece..d184650 100644 --- a/global-functions +++ b/global-functions @@ -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 ]; |