Files
zenbones-theme/lua/zenbones/build.lua

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
648 B
Lua
Raw Normal View History

local theme = require "zenbones"
2021-09-04 15:42:35 +08:00
local terminal = require "zenbones.terminal"
-- got from http://lua-users.org/wiki/StringInterpolation
function interp(s, tab)
return (s:gsub("($%b{})", function(w)
return tab[w:sub(3, -2)] or w
end))
end
2021-09-04 16:40:29 +08:00
local function write_template(path, template, values)
print("[write template] " .. path)
2021-09-04 16:40:29 +08:00
local content = interp(template, values)
local file = io.open(path, "w")
file:write(content)
file:close()
end
local function build()
2021-09-04 17:01:40 +08:00
local templates = { "vim", "kitty", "lualine" }
2021-09-04 16:02:45 +08:00
for _, t in ipairs(templates) do
write_template(unpack(require("zenbones.build." .. t)))
end
end
return { build = build }