Skip to content

Commit

Permalink
fix: Allow non-yaml files in .moon/tasks. (#1080)
Browse files Browse the repository at this point in the history
* Fix non-yaml files.

* Bump version.
  • Loading branch information
milesj authored Sep 28, 2023
1 parent 0618bc6 commit 0c38cc5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
9 changes: 9 additions & 0 deletions .yarn/versions/8dfb2dc3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
releases:
"@moonrepo/cli": patch
"@moonrepo/core-linux-arm64-gnu": patch
"@moonrepo/core-linux-arm64-musl": patch
"@moonrepo/core-linux-x64-gnu": patch
"@moonrepo/core-linux-x64-musl": patch
"@moonrepo/core-macos-arm64": patch
"@moonrepo/core-macos-x64": patch
"@moonrepo/core-windows-x64-msvc": patch
17 changes: 12 additions & 5 deletions nextgen/config/src/inherited_tasks_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,18 @@ fn load_dir(
})?;

if file_type.is_file() {
manager.add_config(
workspace_root,
&path,
InheritedTasksConfig::load_partial(workspace_root, &path)?,
);
// Non-yaml files may be located in these folders,
// so avoid failing when trying to parse it as a config
if path
.extension()
.is_some_and(|ext| ext == "yml" || ext == "yaml")
{
manager.add_config(
workspace_root,
&path,
InheritedTasksConfig::load_partial(workspace_root, &path)?,
);
}
} else if file_type.is_dir() {
load_dir(manager, workspace_root, &path)?;
}
Expand Down
6 changes: 6 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
- More accurately monitors signals (ctrl+c) and shutdowns.
- Tasks can now be configured with a timeout.

## Unreleased

#### 🐞 Fixes

- Fixed an issue where non-YAML files in `.moon/tasks` would be parsed as YAML configs.

## 1.14.1

#### 🐞 Fixes
Expand Down

0 comments on commit 0c38cc5

Please sign in to comment.