From a7339001d2e93c3fb2a957ab782f47d46657619a Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 27 Jan 2019 02:07:12 -0800 Subject: Adding support for windows --- nomsu.moon | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'nomsu.moon') diff --git a/nomsu.moon b/nomsu.moon index 972be7f..240d457 100755 --- a/nomsu.moon +++ b/nomsu.moon @@ -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 -- cgit v1.2.3