Adding support for windows

This commit is contained in:
Bruce Hill 2019-01-27 02:07:12 -08:00
parent 86c48afb88
commit a7339001d2
2 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,10 @@
local clibtype = package.cpath:match("?%.(so)") or package.cpath:match("?%.(dll)")
if clibtype == "dll" then
os.execute("chcp 65001>nul")
end
if NOMSU_VERSION and NOMSU_PREFIX then
package.path = tostring(NOMSU_PREFIX) .. "/share/nomsu/" .. tostring(NOMSU_VERSION) .. "/?.lua;" .. package.path
package.cpath = tostring(NOMSU_PREFIX) .. "/lib/nomsu/" .. tostring(NOMSU_VERSION) .. "/?.so;" .. package.cpath
package.cpath = tostring(NOMSU_PREFIX) .. "/lib/nomsu/" .. tostring(NOMSU_VERSION) .. "/?." .. tostring(clibtype) .. ";" .. package.cpath
end
local EXIT_SUCCESS, EXIT_FAILURE = 0, 1
if _VERSION == "Lua 5.1" and not jit then

View File

@ -1,9 +1,14 @@
#!/usr/bin/env moon
-- This file contains the command-line Nomsu runner.
clibtype = package.cpath\match("?%.(so)") or package.cpath\match("?%.(dll)")
if clibtype == "dll"
-- Special hack to enable utf8 for windows console applications:
os.execute("chcp 65001>nul")
if NOMSU_VERSION and NOMSU_PREFIX
package.path = "#{NOMSU_PREFIX}/share/nomsu/#{NOMSU_VERSION}/?.lua;"..package.path
package.cpath = "#{NOMSU_PREFIX}/lib/nomsu/#{NOMSU_VERSION}/?.so;"..package.cpath
package.cpath = "#{NOMSU_PREFIX}/lib/nomsu/#{NOMSU_VERSION}/?.#{clibtype};"..package.cpath
EXIT_SUCCESS, EXIT_FAILURE = 0, 1