|
|
|
@ -112,10 +112,11 @@ local function inspect(t)
|
|
|
|
|
return fmt([[{ %s }]], table.concat(list, ", "))
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function util.compile(theme)
|
|
|
|
|
function util.compile()
|
|
|
|
|
if vim.fn.has "nvim-0.7" == 0 then
|
|
|
|
|
print "Compiling requires neovim 0.7"
|
|
|
|
|
end
|
|
|
|
|
local theme = require("catppuccin.core.mapper").apply()
|
|
|
|
|
local lines = { [[
|
|
|
|
|
-- This file is autogenerated by CATPPUCCIN.
|
|
|
|
|
-- Do not make changes directly to this file.
|
|
|
|
@ -162,10 +163,15 @@ vim.g.colors_name = "catppuccin"]] }
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
os.execute(string.format("mkdir %s %s", vim.loop.os_uname().sysname == 'Windows' and "" or "-p", config.compile.path))
|
|
|
|
|
print(string.format("mkdir %s %s", vim.loop.os_uname().sysname == 'Windows' and "" or "-p", config.compile.path))
|
|
|
|
|
local file = io.open(config.compile.path .. (vim.loop.os_uname().sysname == 'Windows' and "\\" or "/") .. vim.g.catppuccin_flavour .. config.compile.suffix .. ".lua", "w")
|
|
|
|
|
file:write(table.concat(lines, "\n"))
|
|
|
|
|
file:close()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function util.clean()
|
|
|
|
|
local config = require("catppuccin.config").options
|
|
|
|
|
local compiled_path = config.compile.path .. (vim.loop.os_uname().sysname == 'Windows' and "\\" or "/") .. vim.g.catppuccin_flavour .. config.compile.suffix .. ".lua"
|
|
|
|
|
os.remove(compiled_path)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return util
|
|
|
|
|