chore: removed redundant lines in templates

This commit is contained in:
DarthMooMancer
2025-05-12 09:31:27 -04:00
parent 3a50bf9375
commit 1306f86a65
2 changed files with 3 additions and 5 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ end
function M.run()
local root = utils.get_project_root()
local cmd = { "cd " .. root, "build", " && cmake --build ." }
local cmd = { "cd " .. root, "build && cmake --build ." }
local output = vim.fn.system(table.concat(cmd, "/"))
if not vim.v.shell_error == 0 then
+2 -4
View File
@@ -232,7 +232,6 @@ M.aux_files = {
c = {
run = function (file_name)
if not file_name then return print("Header file creation canceled") end
local root = utils.get_project_root()
local guard_macro = file_name:upper():gsub("[^A-Z0-9]", "_") .. "_H"
local content = string.format([[
#ifndef %s
@@ -242,13 +241,12 @@ M.aux_files = {
#endif
]], guard_macro, guard_macro)
utils.write_file({ root, "include", file_name .. ".h" }, content)
utils.write_file({ utils.get_project_root(), "include", file_name .. ".h" }, content)
end
},
cpp = {
run = function(file_name)
if not file_name then return print("Header file creation canceled") end
local root = utils.get_project_root()
local guard_macro = file_name:upper():gsub("[^A-Z0-9]", "_") .. "_HPP"
local content = string.format([[
#ifndef %s
@@ -258,7 +256,7 @@ M.aux_files = {
#endif
]], guard_macro, guard_macro, guard_macro)
utils.write_file({ root, "include", file_name .. ".hpp" }, content)
utils.write_file({ utils.get_project_root(), "include", file_name .. ".hpp" }, content)
end
}
}