219 |
219 |
220 function env.Include(file, wildcard) |
220 function env.Include(file, wildcard) |
221 if file:match("[*?]") then |
221 if file:match("[*?]") then |
222 local path_pos, glob = file:match("()([^"..path_sep.."]+)$"); |
222 local path_pos, glob = file:match("()([^"..path_sep.."]+)$"); |
223 local path = file:sub(1, math_max(path_pos-2,0)); |
223 local path = file:sub(1, math_max(path_pos-2,0)); |
|
224 local config_path = config_file:gsub("[^"..path_sep.."]+$", ""); |
224 if #path > 0 then |
225 if #path > 0 then |
225 path = resolve_relative_path(config_file:gsub("[^"..path_sep.."]+$", ""), path); |
226 path = resolve_relative_path(config_path, path); |
226 else |
227 else |
227 path = "."; |
228 path = config_path; |
228 end |
229 end |
229 local patt = glob_to_pattern(glob); |
230 local patt = glob_to_pattern(glob); |
230 for f in lfs.dir(path) do |
231 for f in lfs.dir(path) do |
231 if f:sub(1,1) ~= "." and f:match(patt) then |
232 if f:sub(1,1) ~= "." and f:match(patt) then |
232 env.Include(path..path_sep..f); |
233 env.Include(path..path_sep..f); |