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') local handle = io.popen(self.clip_cmd, 'w')
if handle then if handle then
handle:write(text) handle:write(text)
local suc, exit, code = handle:close() local success, status, signal = handle:close()
return { status = code } if success then
status = 0
end
return { status = status }
else else
return { status = 1 } return { status = 1 }
end end