diff options
author | Rui Guo <guorui.xt@gmail.com> | 2016-10-28 05:21:33 +0300 |
---|---|---|
committer | Rui Guo <guorui.xt@gmail.com> | 2016-10-28 05:21:33 +0300 |
commit | 5f6b4bebe11576db540fe55295192d1a1fd3843a (patch) | |
tree | ece9eddede48d8f8a205b936d335a4067e42b9cf | |
parent | 512e61a3e23fa3fd5bf84f09f380131552c2fff2 (diff) |
fix fexecute for windows
-rw-r--r-- | init.lua | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -50,13 +50,13 @@ sys.execute = execute function sys.fexecute(cmd, readwhat) readwhat = readwhat or '*all' local tmpfile = os.tmpname() - local cmd = cmd .. ' 1>'.. tmpfile..' 2>' .. tmpfile + local cmd = cmd .. ' >'.. tmpfile..' 2>&1' os.execute(cmd) local file = _G.assert(io.open(tmpfile)) local s= file:read(readwhat) file:close() s = s:gsub('^%s*',''):gsub('%s*$','') - os.execute('rm ' .. tmpfile) + os.remove(tmpfile) return s end |