magefile / mage

a Make/rake-like dev tool using Go
https://magefile.org
Apache License 2.0
4.01k stars 250 forks source link

Enhancement: Use mage from project sub directories, by making mage look for magefiles in parent directories if not found #468

Open pantsmann opened 1 year ago

pantsmann commented 1 year ago

Describe the feature I'd like to be able to run mage from any project directory and access the targets defined in mage files in the project root. I'd like to do this by default without adding the -d option. Mage would search parent directories the same as it searches the current directory and stop searching when it arrives at the system root or when it finds mage files.

What problem does this feature address? I think this makes mage just a little bit easier and quicker to use.

Additional context I've got a branch and PR for doing this

mloskot commented 7 months ago

Great idea, not longer than two days ago I was looking for just that in mage features. I keep my Magefile-s in the magefiles/ subfolder of the root. It would be very useful if I can step into account/environment/stack and run mage deploy there, and Mage can climb up until it finds my magefiles/and executes 😊