diff --git a/worldeditadditions_core/utils/format/init.lua b/worldeditadditions_core/utils/format/init.lua index f4b1e8e..dc75fe3 100644 --- a/worldeditadditions_core/utils/format/init.lua +++ b/worldeditadditions_core/utils/format/init.lua @@ -4,7 +4,6 @@ local wea_c = worldeditadditions_core wea_c.format = { array_2d = dofile(wea_c.modpath.."/utils/format/array_2d.lua"), escape = dofile(wea_c.modpath.."/utils/format/escape.lua"), - file_path = dofile(wea_c.modpath.."/utils/format/file_path.lua"), human_size = dofile(wea_c.modpath.."/utils/format/human_size.lua"), human_time = dofile(wea_c.modpath.."/utils/format/human_time.lua"), make_ascii_table = dofile(wea_c.modpath.."/utils/format/make_ascii_table.lua"), diff --git a/worldeditadditions_core/utils/path/init.lua b/worldeditadditions_core/utils/path/init.lua new file mode 100644 index 0000000..c6fb880 --- /dev/null +++ b/worldeditadditions_core/utils/path/init.lua @@ -0,0 +1,5 @@ +local wea_c = worldeditadditions_core + +wea_c.path = { + file_path = dofile(wea_c.modpath.."/utils/format/file_path.lua"), +} diff --git a/worldeditadditions_core/utils/format/file_path.lua b/worldeditadditions_core/utils/path/join.lua similarity index 90% rename from worldeditadditions_core/utils/format/file_path.lua rename to worldeditadditions_core/utils/path/join.lua index 751ed49..6ea8148 100644 --- a/worldeditadditions_core/utils/format/file_path.lua +++ b/worldeditadditions_core/utils/path/join.lua @@ -7,11 +7,11 @@ local wea_c = worldeditadditions_core -- @return string The joined path. -- @example Basic usage -- local path = file_path("C:\\Users", "me", "/Documents/code.lua") -local file_path = function( ... ) +local join = function( ... ) local path = { ... } for i, v in ipairs(path) do path[i] = tostring(v) end return ({table.concat(path, wea_c.dirsep) :gsub("[/\\]+", wea_c.dirsep)})[1] end -return file_path \ No newline at end of file +return join \ No newline at end of file