set status to 0 if succeeded

This commit is contained in:
Ren Tatsumoto 2023-09-10 17:01:57 +03:00
parent 5d0e4f4415
commit 7872c5154d

View file

@ -60,8 +60,11 @@ this.clipboard = (function()
local handle = io.popen(self.clip_cmd, 'w')
if handle then
handle:write(text)
local suc, exit, code = handle:close()
return { status = code }
local success, status, signal = handle:close()
if success then
status = 0
end
return { status = status }
else
return { status = 1 }
end