Improve the behavior of --dir and --file #55
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the upcoming release of Embedded Runs, we need to better define the behavior around
--dir
and--file
.Previously, these flags were mutually exclusive. You could provide:
.mint
in your working directory and try to run any task definitions at the top-level of that folder--dir some-dir
. In this case, we'd look in that directory for run definitions and try to run them--file some-file.yml
. In this case, we'd ignore any.mint
directories and simply send the one task definition you specifiedMoving forward, embedded runs need the context of a
.mint
dir to populate the run definitions that can be statically embedded (viacall: ${{ mint.run-dir }}/tasks.yml
). To facilitate this, the CLI needs to differentiate between the task definitions that we intend to run and the ones which should be treated as the mint dir for a run.Now, you can provide:
.mint
dir no no.mint
dir--dir some-dir --file somewhere-else/tasks.yml
. In this case, the contents ofsome-dir
can be referenced by static embedded runs andsomewhere-else/tasks.yml
will be the definition we use to start your run--dir some-dir
. In this case, we'll read the contents ofsome-dir
, use it as the mint dir for embedded runs and try to start runs with the definitions in the directory--file somewhere-else/tasks.yml
. In this case, we'll perform the traversal logic to populate the mint dir and usesomewhere-else/tasks.yml
to start your run