summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-05-01 14:14:19 +0800
committerruki <[email protected]>2022-05-01 14:14:19 +0800
commit973fdebd73cc0f4db070a958bd4f83f9be0518c9 (patch)
tree804dabed29ece76f352ad8e8e825f667a873f643
parent91d3f55bf5400ecf07c094c5fa3f05e910c5f51c (diff)
improve filesync
-rw-r--r--xmake/modules/private/service/remote_build/filesync.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/xmake/modules/private/service/remote_build/filesync.lua b/xmake/modules/private/service/remote_build/filesync.lua
index 7548b3987..4b5c5f250 100644
--- a/xmake/modules/private/service/remote_build/filesync.lua
+++ b/xmake/modules/private/service/remote_build/filesync.lua
@@ -137,10 +137,16 @@ function filesync:_ignorefiles_load(ignorefiles)
local filepath = path.join(gitroot, line)
local pattern = path.relative(filepath, rootdir)
if pattern then
- if not line:endswith(path.sep()) then
+ if line:endswith(path.sep()) or os.isdir(line) then
+ table.insert(ignorefiles, path.join(pattern, "**"))
+ elseif os.isfile(line) then
table.insert(ignorefiles, pattern)
+ elseif line:find("*.", 1, true) then
+ table.insert(ignorefiles, (pattern:gsub("%*%.", "**.")))
+ else
+ table.insert(ignorefiles, pattern)
+ table.insert(ignorefiles, path.join(pattern, "**"))
end
- table.insert(ignorefiles, path.join(pattern, "**"))
end
end
end