fix(cmd): use process ID for cache

resolves #5182
This commit is contained in:
Jan De Dobbeleer 2024-06-28 20:49:11 +02:00 committed by Jan De Dobbeleer
parent a184317279
commit dc002fc1e1

View file

@ -7,16 +7,7 @@ if '::UPGRADE::' == 'true' then
end
-- Cache PID
function generateCustomUUID()
local template = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
return string.gsub(template, '[x]', function(c)
local v = math.random(0, 0xf)
return string.format('%x', v)
end)
end
os.setenv("POSH_PID", generateCustomUUID())
os.setenv("POSH_PID", os.getpid())
-- Helper functions