chore: removed redundant lines in templates
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user