diff options
author | Soumith Chintala <soumith@gmail.com> | 2016-10-28 05:44:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-28 05:44:49 +0300 |
commit | f073f057d3fd2148866eaa0444a62ababfdf935e (patch) | |
tree | ece9eddede48d8f8a205b936d335a4067e42b9cf | |
parent | 512e61a3e23fa3fd5bf84f09f380131552c2fff2 (diff) | |
parent | 5f6b4bebe11576db540fe55295192d1a1fd3843a (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 |