felangel / mason

Tools which allow developers to create and consume reusable templates called bricks.
https://docs.brickhub.dev
974 stars 97 forks source link

feat: set default output directory #1308

Closed PeterJ504 closed 3 months ago

PeterJ504 commented 5 months ago

Description

I have a block that I always want created in the same directory. I can use the -o option but it gets tedious as the directory path is long and constant. Is there a way to default the brick output directory to something else.

Perhaps adding a tag in the mason.yaml file would work.

felangel commented 5 months ago

Hi @PeterJ504 👋 Thanks for opening an issue!

Can you provide a bit more context (for example what brick you're using and the full mason command you're running)?

PeterJ504 commented 5 months ago

Hi @felangel. Sure. Let's say I have my own global brick called project. I want all projects to create a subdirectory in the same root directory. Currently, to make a new project I type mason make project -o c:\Users\Robert\OneDrive\Coding\flutter\projects Since all projects go into the same folder, I'd like to be able to default the output directory so that I don't have to always type the long location name. One solution would be to add a line in the brick's mason.yaml file. Something like: default_dir: c:\Users\Robert\OneDrive\Coding\flutter\projects Then when I run make again, if I don't specify the -o option, it will go in the default output directory instead of the current directory.

felangel commented 3 months ago

@PeterJ504 since this is a per-machine/user configuration I recommend just creating a bash alias. Happy to revisit this if you or others feel strongly about it, thanks!