maid icon indicating copy to clipboard operation
maid copied to clipboard

Global location for maid file

Open jakepearson opened this issue 6 years ago • 8 comments

If there is not a maidfile.md in the current directory then look in the user's root for a file something like .maidfile.md

jakepearson avatar May 31 '18 13:05 jakepearson

that's neat but I'm afraid that it will cause confusion.

egoist avatar May 31 '18 13:05 egoist

Potentially, but it also means I could create a set of scripts that I could use from anywhere in my system.

jakepearson avatar May 31 '18 13:05 jakepearson

what about something like maid global build which will run build task from the maidfile in user's home dir 🤔

egoist avatar May 31 '18 13:05 egoist

This is a pretty common convention. Hashicorp's vagrant and docker-compose will scan down each of the parent directories of the current directory to find its manifest (Vagrantfile and docker-compose.yml respectively), presumably halting at the user's home directory.

gthole avatar May 31 '18 14:05 gthole

I like @gthole idea even better. Just look up a directory until you find a maid file or give up at the home directory.

jakepearson avatar May 31 '18 14:05 jakepearson

I'm against maid global, try to not pollute tasks namespace as much as possible, and also this will allow calling multiple commands/tasks (like gulp) in series/parallel (btw would be flags).

As about searching, https://github.com/jonschlinkert/find-file-up (with the limit set) is the way to go, definitely. This approach has one more bonus - make maid work for monorepos.

tunnckoCore avatar Jun 04 '18 22:06 tunnckoCore

Even best would be to drop support for other files and support only .?maidfile.md from cwd to home - by that i mean it still will be able to define --path README.md or --path CONTRIBUTING.md though :) I like that it allows to use README.md, but it may complicate the things exactly because it is common file.

Actually i'm playing with some implementations and may pr if i've done something.

tunnckoCore avatar Jun 05 '18 00:06 tunnckoCore

Implemented in #37. If merged you can add ~/.maidfile.md and just start using maid without passing any flags.

tunnckoCore avatar Jun 06 '18 08:06 tunnckoCore