diff options
author | samehkhamis <sameh.khamis@gmail.com> | 2015-07-24 03:36:04 +0300 |
---|---|---|
committer | samehkhamis <sameh.khamis@gmail.com> | 2015-07-24 03:36:04 +0300 |
commit | 0dec9deca56f09ecf8c8e11cbc1a0d9cc3a891e6 (patch) | |
tree | a82edfb0c8b1a725c7c28dfd547d09e2961ea802 /init.lua | |
parent | 775ed6c39195470da876ab111bf02cc6b790e04e (diff) |
Work under windows
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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()} |