-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: Make directory task include also support toml files #10219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2281,7 +2281,7 @@ async fn load_tasks_includes( | |
| if root.is_file() && root.extension().map(|e| e == "toml").unwrap_or(false) { | ||
| load_task_file(config, root, config_root, task_config_dir).await | ||
| } else if root.is_dir() { | ||
| let files = WalkDir::new(root) | ||
| let all_files = WalkDir::new(root) | ||
| .follow_links(true) | ||
| .into_iter() | ||
| // skip hidden directories (if the root is hidden that's ok) | ||
|
|
@@ -2290,7 +2290,6 @@ async fn load_tasks_includes( | |
| .map_ok(|e| e.path().to_path_buf()) | ||
| .try_collect::<_, Vec<PathBuf>, _>()? | ||
| .into_iter() | ||
| .filter(|p| file::is_executable(p)) | ||
| .filter(|p| { | ||
| !Settings::get() | ||
| .task | ||
|
|
@@ -2299,10 +2298,18 @@ async fn load_tasks_includes( | |
| .any(|d| p.starts_with(d)) | ||
| }) | ||
| .collect::<Vec<_>>(); | ||
| let is_toml = |p: &Path| p.extension().map(|e| e == "toml").unwrap_or(false); | ||
| let (toml_files, exec_files): (Vec<_>, Vec<_>) = all_files | ||
| .into_iter() | ||
| .filter(|p| is_toml(p) || file::is_executable(p)) | ||
| .partition(|p| is_toml(p)); | ||
| let mut tasks = vec![]; | ||
| for path in toml_files { | ||
| tasks.extend(load_task_file(config, &path, config_root, task_config_dir).await?); | ||
| } | ||
|
Comment on lines
+2307
to
+2309
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| let root = Arc::new(root.to_path_buf()); | ||
| let config_root = Arc::new(config_root.to_path_buf()); | ||
| for path in files { | ||
| for path in exec_files { | ||
| let root = root.clone(); | ||
| let config_root = config_root.clone(); | ||
| let config = config.clone(); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.