aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nomsu.lua14
-rwxr-xr-xnomsu.moon12
2 files changed, 16 insertions, 10 deletions
diff --git a/nomsu.lua b/nomsu.lua
index ee2625c..f35c4a1 100644
--- a/nomsu.lua
+++ b/nomsu.lua
@@ -10,12 +10,16 @@ if NOMSU_PREFIX then
end
COLOR_ENABLED = true
if clibtype == "dll" then
- local enable_colors = require('wincolors')
- local ok, _ = pcall(enable_colors)
- if not ok then
- COLOR_ENABLED = false
+ local ok, enable_colors = pcall(require, 'wincolors')
+ COLOR_ENABLED = false
+ if ok then
+ local _
+ ok, _ = pcall(enable_colors)
+ if ok then
+ COLOR_ENABLED = false
+ end
end
- os.execute("chcp 65001>nul")
+ pcall(os.execute, "chcp 65001>nul")
end
local List, Dict
do
diff --git a/nomsu.moon b/nomsu.moon
index 4ffb7c8..b9e36c2 100755
--- a/nomsu.moon
+++ b/nomsu.moon
@@ -13,12 +13,14 @@ export COLOR_ENABLED
COLOR_ENABLED = true
if clibtype == "dll"
-- Enable colors:
- enable_colors = require('wincolors')
- ok,_ = pcall(enable_colors)
- if not ok
- COLOR_ENABLED = false
+ ok,enable_colors = pcall(require, 'wincolors')
+ COLOR_ENABLED = false
+ if ok
+ ok,_ = pcall(enable_colors)
+ if ok
+ COLOR_ENABLED = false
-- Special hack to enable utf8 for windows console applications:
- os.execute("chcp 65001>nul")
+ pcall(os.execute,"chcp 65001>nul")
{:List, :Dict} = require 'containers'
NOMSU_VERSION = List(NOMSU_VERSION)