dotfiles/.config/keyb/merge.lua

18 lines
609 B
Lua

local config_dir = "/home/bryan/.config/keyb"
local output_filename = "merged.yml"
local output_filename_full = vim.fs.joinpath(config_dir, output_filename)
vim.system({ "mv", output_filename_full, output_filename_full .. ".bak" }):wait()
local outfile = io.open(output_filename_full, "a")
print(output_filename_full)
for file in vim.fs.dir(config_dir) do
if file:match("%.yml$") and not file:match("config") and not file:match(output_filename) then
vim.print(file)
local infile = io.open(vim.fs.joinpath(config_dir, file), "r")
local contents = infile:read("*a")
outfile:write(contents)
end
end