foundryvtt-wh4-lang-fr-fr/tools/detect_identical_files.lua

25 lines
574 B
Lua
Raw Permalink Normal View History

2024-06-09 17:08:53 +02:00
local lfs = require"lfs"
local src = "../reference_scripts/"
local dst = "../scripts/"
for file in lfs.dir(src) do
if file == '.' or file == '..' then
else
local fp1 = io.open(dst..file, "r+")
local fp2 = io.open(src..file, "r+")
if fp1 and fp2 then
-- Compare files
local content1 = fp1:read("*all")
local content2 = fp2:read("*all")
if content1 == content2 then
print("Identical files: "..file)
end
fp1:close()
fp2:close()
else
print("Error: Could not open file: "..file)
end
end
end