diff --git a/ChangeLog b/ChangeLog index bd835b0..66288b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ -2018-03-09: 2.4.0 - enhancement: add nix flake support +2021-03-09: 2.3.0 + add: nix flake support + add: support for tunnel commands + add: support for batchSizeLimit + add: -onepass option change: support relative executable paths 2018-03-09: 2.2.3 diff --git a/lsyncd.lua b/lsyncd.lua index 31aa9eb..49e529e 100644 --- a/lsyncd.lua +++ b/lsyncd.lua @@ -4616,7 +4616,7 @@ local function splitPath end end -function splitQuotedString +local function splitQuotedString ( text ) @@ -4645,6 +4645,8 @@ function splitQuotedString return rv end +lsyncd.splitQuotedString = splitQuotedString + function substitudeCommands(cmd, data) assert(type(data) == "table") local getData = function(arg) diff --git a/tests/utils_test.lua b/tests/utils_test.lua index c793c3f..218ab1a 100644 --- a/tests/utils_test.lua +++ b/tests/utils_test.lua @@ -5,7 +5,7 @@ cwriteln( ' Testing Utils Functions ' ) cwriteln( '****************************************************************' ) assert(isTableEqual( - splitQuotedString("-p 22 -i '/home/test/bla blu/id_rsa'"), + lsyncd.splitQuotedString("-p 22 -i '/home/test/bla blu/id_rsa'"), {"-p", "22", "-i", "/home/test/bla blu/id_rsa"} )) @@ -14,14 +14,18 @@ local testData = { localPort = 1234, localHost = "localhorst" } -assert(substitudeCommands("echo ssh ${localHost}:${localPort}", testData) == - "echo ssh localhorst:1234") assert(isTableEqual( - substitudeCommands({"-p${doesNotExist}", "2${localHost}2", "-i '${localPort}'"}, testData), - {"-p", "2localhorst2", "-i '1234'"} + substitudeCommands({"-p^doesNotExist", "2^localHostA", "-i '^localPort'"}, testData), + {"-p^doesNotExist", "2localhorstA", "-i '1234'"} )) +assert( + substitudeCommands("-p^doesNotExist 2^localHostA -i '^localPort'", testData), + "-p^doesNotExist 2localhorstA -i '1234'" +) + + assert(type(lsyncd.get_free_port()) == "number") os.exit(0) \ No newline at end of file