Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions sh.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ local function flatten(t)
table.insert(result.args, arg(key, v))
end
end
if result.input == '' then
result.input = nil
end
end

f(t)
Expand Down Expand Up @@ -62,8 +65,9 @@ local function command(cmd, ...)
local p = io.popen(s, 'r')
local output = p:read('*a')
local _, exit, status = p:close()
os.remove(M.tmpfile)

if args.input then
os.remove(M.tmpfile)
end
local t = {
__input = output,
__exitcode = exit == 'exit' and status or 127,
Expand Down