From 8ef787572a983f769f6170818442d2b76211260c Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 2 May 2019 15:42:00 -0700 Subject: Fail-safe fix for windows if the windows color dll doesn't load correctly. --- nomsu.moon | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'nomsu.moon') 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) -- cgit v1.2.3