| ... | @@ -30,6 +30,16 @@ pub fn make( | ... | @@ -30,6 +30,16 @@ pub fn make( |
| 30 | var open_dirs_count: u32 = 0; | 30 | var open_dirs_count: u32 = 0; |
| 31 | defer Io.Dir.closeMany(io, open_dir_cache[0..open_dirs_count]); | 31 | defer Io.Dir.closeMany(io, open_dir_cache[0..open_dirs_count]); |
| 32 | | 32 | |
| | 33 | for (directories, open_dir_cache) |conf_dir, *opened_dir| { |
| | 34 | const src_lazy_path = conf_dir.src_path.get(conf); |
| | 35 | const src_dir_path = try maker.resolveLazyPath(arena, src_lazy_path, step_index); |
| | 36 | |
| | 37 | opened_dir.* = src_dir_path.root_dir.handle.openDir(io, src_dir_path.subPathOrDot(), .{ .iterate = true }) catch |err| { |
| | 38 | return step.fail(maker, "failed opening source directory {f}: {t}", .{ src_dir_path, err }); |
| | 39 | }; |
| | 40 | open_dirs_count += 1; |
| | 41 | } |
| | 42 | |
| 33 | // Doesn't yet include contents of directories. | 43 | // Doesn't yet include contents of directories. |
| 34 | var total_items: usize = conf_wf.embeds.slice.len + conf_wf.copies.slice.len + conf_wf.directories.slice.len; | 44 | var total_items: usize = conf_wf.embeds.slice.len + conf_wf.copies.slice.len + conf_wf.directories.slice.len; |
| 35 | progress_node.setEstimatedTotalItems(total_items); | 45 | progress_node.setEstimatedTotalItems(total_items); |
| ... | @@ -58,7 +68,7 @@ pub fn make( | ... | @@ -58,7 +68,7 @@ pub fn make( |
| 58 | try step.addWatchInput(maker, arena, src_lazy_path); | 68 | try step.addWatchInput(maker, arena, src_lazy_path); |
| 59 | } | 69 | } |
| 60 | | 70 | |
| 61 | for (directories, open_dir_cache) |conf_dir, *opened_dir| { | 71 | for (directories, open_dir_cache) |conf_dir, src_dir| { |
| 62 | const exclude_extensions = conf_dir.exclude_extensions.slice(conf) orelse &.{}; | 72 | const exclude_extensions = conf_dir.exclude_extensions.slice(conf) orelse &.{}; |
| 63 | const include_extensions = conf_dir.include_extensions.slice(conf); | 73 | const include_extensions = conf_dir.include_extensions.slice(conf); |
| 64 | | 74 | |
| ... | @@ -72,12 +82,6 @@ pub fn make( | ... | @@ -72,12 +82,6 @@ pub fn make( |
| 72 | const need_derived_inputs = try step.addDirectoryWatchInput(maker, src_lazy_path); | 82 | const need_derived_inputs = try step.addDirectoryWatchInput(maker, src_lazy_path); |
| 73 | const src_dir_path = try maker.resolveLazyPath(arena, src_lazy_path, step_index); | 83 | const src_dir_path = try maker.resolveLazyPath(arena, src_lazy_path, step_index); |
| 74 | | 84 | |
| 75 | var src_dir = src_dir_path.root_dir.handle.openDir(io, src_dir_path.subPathOrDot(), .{ .iterate = true }) catch |err| { | | |
| 76 | return step.fail(maker, "failed opening source directory {f}: {t}", .{ src_dir_path, err }); | | |
| 77 | }; | | |
| 78 | opened_dir.* = src_dir; | | |
| 79 | open_dirs_count += 1; | | |
| 80 | | | |
| 81 | var it = try src_dir.walk(gpa); | 85 | var it = try src_dir.walk(gpa); |
| 82 | defer it.deinit(); | 86 | defer it.deinit(); |
| 83 | while (it.next(io) catch |err| switch (err) { | 87 | while (it.next(io) catch |err| switch (err) { |