Skip to content

Commit 0dec9de

Browse files
committed
Work under windows
1 parent 775ed6c commit 0dec9de

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

init.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ rawset(_G, 'xprint', xlua.print)
110110
-- log all session, by replicating stdout to a file
111111
----------------------------------------------------------------------
112112
function xlua.log(file)
113-
os.execute('mkdir -p "' .. sys.dirname(file) .. '"')
113+
os.execute('mkdir ' .. (sys.uname() ~= 'windows' and '-p ' or '') .. ' "' .. sys.dirname(file) .. '"')
114114
local f = assert(io.open(file,'w'))
115115
io._write = io.write
116116
_G._print = _G.print
@@ -220,6 +220,7 @@ local formatTime = xlua.formatTime
220220
----------------------------------------------------------------------
221221
do
222222
local function getTermLength()
223+
if sys.uname() == 'windows' then return 80 end
223224
local tputf = io.popen('tput cols', 'r')
224225
local w = tonumber(tputf:read('*a'))
225226
local rc = {tputf:close()}

0 commit comments

Comments
 (0)