fix(compiler): Match 'Windows_NT' uname

On Windows 11, the uname returned is 'Windows_NT' and therefore,
this commit includes 'Windows_NT' within the check so that the
compiler works properly on Windows operating systems.
dev
sgoudham 2 years ago
parent 03336345d6
commit 9dd074cca2
Signed by: hammy
GPG Key ID: 44E818FD5457EEA4

@ -2,6 +2,8 @@ local M = {}
-- Credit: https://github.com/EdenEast/nightfox.nvim -- Credit: https://github.com/EdenEast/nightfox.nvim
local fmt = string.format local fmt = string.format
local sysname = vim.loop.os_uname().sysname
local function inspect(t) local function inspect(t)
local list = {} local list = {}
for k, v in pairs(t) do for k, v in pairs(t) do
@ -68,11 +70,15 @@ vim.g.colors_name = "catppuccin"]],
end end
end end
os.execute( os.execute(
string.format("mkdir %s %s", vim.loop.os_uname().sysname == "Windows" and "" or "-p", config.compile.path) string.format(
"mkdir %s %s",
(sysname == "Windows" or sysname == "Windows_NT") and "" or "-p",
config.compile.path
)
) )
local file = io.open( local file = io.open(
config.compile.path config.compile.path
.. (vim.loop.os_uname().sysname == "Windows" and "\\" or "/") .. ((sysname == "Windows" or sysname == "Windows_NT") and "\\" or "/")
.. vim.g.catppuccin_flavour .. vim.g.catppuccin_flavour
.. config.compile.suffix .. config.compile.suffix
.. ".lua", .. ".lua",
@ -85,7 +91,7 @@ end
function M.clean() function M.clean()
local config = require("catppuccin.config").options local config = require("catppuccin.config").options
local compiled_path = config.compile.path local compiled_path = config.compile.path
.. (vim.loop.os_uname().sysname == "Windows" and "\\" or "/") .. ((sysname == "Windows" or sysname == "Windows_NT") and "\\" or "/")
.. vim.g.catppuccin_flavour .. vim.g.catppuccin_flavour
.. config.compile.suffix .. config.compile.suffix
.. ".lua" .. ".lua"

Loading…
Cancel
Save