From 0dec9deca56f09ecf8c8e11cbc1a0d9cc3a891e6 Mon Sep 17 00:00:00 2001 From: samehkhamis Date: Thu, 23 Jul 2015 17:36:04 -0700 Subject: Work under windows --- init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index e6036b1..b803786 100644 --- a/init.lua +++ b/init.lua @@ -110,7 +110,7 @@ rawset(_G, 'xprint', xlua.print) -- log all session, by replicating stdout to a file ---------------------------------------------------------------------- function xlua.log(file) - os.execute('mkdir -p "' .. sys.dirname(file) .. '"') + os.execute('mkdir ' .. (sys.uname() ~= 'windows' and '-p ' or '') .. ' "' .. sys.dirname(file) .. '"') local f = assert(io.open(file,'w')) io._write = io.write _G._print = _G.print @@ -220,6 +220,7 @@ local formatTime = xlua.formatTime ---------------------------------------------------------------------- do local function getTermLength() + if sys.uname() == 'windows' then return 80 end local tputf = io.popen('tput cols', 'r') local w = tonumber(tputf:read('*a')) local rc = {tputf:close()} -- cgit v1.2.3