Commit 0861b8ce authored by co887baqi's avatar co887baqi

Fix hardwired directory oversight in sample script

parent 4a35e518
......@@ -105,7 +105,7 @@ local BASE_DERIVATE = [[<?xml version="1.0" encoding="UTF-8"?>
<linkmeta inherited="0" xlink:type="locator" xlink:href="ULBeeHealth_anihealth_<&ID_OBJECT_PADDED&>" />
</linkmetas>
<internals class="MCRMetaIFS" heritable="false">
<internal inherited="0" sourcepath="/home/bt1cn/data/mycore/app_save/anihealth/ULBeeHealth_derivate_Server/ULBeeHealth_derivate_<&ID_DERIVATE_PADDED&>" maindoc="example.png" />
<internal inherited="0" sourcepath="<&PWD&>/ULBeeHealth_derivate_Server/ULBeeHealth_derivate_<&ID_DERIVATE_PADDED&>" maindoc="example.png" />
</internals>
</derivate>
<service>
......@@ -1404,6 +1404,10 @@ local function replacePlaceholders (base, replacements)
return replaced[1]
end
local PWD_handle = io.popen ("pwd")
local PWD = PWD_handle:read("*l")
PWD_handle:close()
local id_derivate = 1
math.randomseed (os.time())
local chanceDerivate = math.floor (256 * _G.CHANCE_DERIVATE)
......@@ -1411,7 +1415,10 @@ local chanceDerivate = math.floor (256 * _G.CHANCE_DERIVATE)
for i = 1, _G.COUNT do
local hasDerivate = math.random (256) <= chanceDerivate
print (PWD)
local vars = {
PWD = PWD,
ID_OBJECT = tostring (i),
ID_OBJECT_PADDED = string.format ("%08i", i),
ID_DERIVATE_PADDED = string.format ("%08i", id_derivate),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment