aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-02-13 10:14:11 +0100
committerGravatar Christian Hesse <mail@eworm.de>2023-02-13 10:36:56 +0100
commitd54c46ab98224c51675e74846362e80cb5f9102b (patch)
treeb17b57f2f588b6da4fd0af5aa08bf993ad178763
parent7d3c4738d07e040cbe3c293ef0b2be04631290eb (diff)
global-functions: introduce $Dos2Unix
-rw-r--r--global-functions10
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 ];