Skip to content

Do moon repo offer lifecycle scripts? #806

Answered by milesj
diraneyya asked this question in Q&A
Discussion options

You must be logged in to vote

@diraneyya Great question! Thanks for the in-depth discussion. At this time we do not support life-cycles, but it is definitely on our roadmap. Locking down what the API would look like is the hardest part.

However, there is an approach that you could possible use. If you want a global "setup everything" kind of task, you can use implicitDeps: https://moonrepo.dev/docs/config/tasks#implicitdeps

With this, you can define a task in .moon/tasks.yml, and have it be inherited by every task as a dependency. So anytime a task is ran, this setup task will be also. Something like this:

implicitDeps:
  - '~:globalSetup'

tasks:
  globalSetup:
    command: 'do something'

This should work how you wan…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by diraneyya
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants