import
(or source
) in addition to include
(alternative to "flattening")
#1670
Closed
tomharrisonjr
started this conversation in
Ideas
Replies: 2 comments
-
You might want to take a look at this comment where I suggest a way method which can be used to realise this use case. I encourage you to try it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I just spent some significant effort reworking a few projects so that they can all share common tasks via
include
. When I first read aboutinclude
I assumed they were just a simple C-style import (or bashsource
). But include is more sophisticated ... but that's not always what's needed. Include creates an implicit namespace, and creates several other dependencies such as schema -- so that included tasks become more like callable functions. This is valid, and needed in many cases, but more work and planning.In my case (and based on the recurring questions from others) there may be simpler use-cases. For example, each of my projects has a
docker compose up -d
and adocker compose down
task, along with a number of others that vary little or none between projects. Some of the commands get tricky as you start adding options and environments, and others are pipelines of several commands, so mostly I am just insulating users from needing to care, and ensuring consistency.In this case, an alternate command such as
import
that simply reads the file into the current context would seem to solve the simpler requirement. The file would simply lists tasks that are suitable for import into a project as though they had been written there. (For the file to be valid YAML, perhaps just include thetasks:
element, and ignore).Beta Was this translation helpful? Give feedback.
All reactions