39 lines
1021 B
Plaintext
Executable File
39 lines
1021 B
Plaintext
Executable File
-- package a folder recursively into a rage packfile
|
|
-- KS 22/08/2006
|
|
|
|
|
|
function copyFilesRecursive(destpath, srcpath, filter)
|
|
copyFilesInFolder(destpath, srcpath, filter);
|
|
|
|
local paths = find_dirs(srcpath);
|
|
|
|
for key, value in paths do
|
|
local subpath = destpath .. value .. "\\";
|
|
local relativesubpath = srcpath .. value .. "\\";
|
|
|
|
if copyFilesRecursive(subpath, relativesubpath, filter) == 0 then
|
|
return 0;
|
|
end
|
|
end
|
|
return 1;
|
|
end
|
|
|
|
function copyFilesInFolder(destpath, srcpath, filter)
|
|
local files = find_files( srcpath .. filter );
|
|
|
|
for key, value in files do
|
|
create_leadingpath(destpath .. value)
|
|
set_file_attrib(destpath .. value, "readonly", false)
|
|
copy_file(srcpath .. value, destpath .. value)
|
|
end
|
|
end
|
|
|
|
function copyFiles(destpath, srcpath, filter)
|
|
copyFilesRecursive(destpath, srcpath, filter);
|
|
end
|
|
|
|
local filter = get_param("filter")
|
|
local destpath = get_param("destpath")
|
|
local srcpath = get_param("srcpath")
|
|
copyFiles(destpath, srcpath, filter)
|