Best practice for installing config files in home directory

(Alexander Mancevice) #1

I am writing a formula for my company’s private tap to install the AWS ECR login helper tool. The last step is to modify the file in ~/.docker/config to include our ECR name. This is obviously not going to work inside the install step because of sandboxing.

What’s the best-practice for modifying files like this? I could add something in caveats but it’d really be nice (especially for our non-technical users) to just do the change automatically.

(Joshua McKinney) #2

Think about the technical users at the same time as non-technical. If I were someone in your org that used docker, I wouldn’t want an install to mess around with my config files automatically. Caveats are the right way IMO to handle this.

(Alexander Mancevice) #3

Thanks, I can see your point. The trade-offs are important to consider but – at least the way we use Docker – the config file isn’t really all that important. Even if it were to be erased entirely it wouldn’t be the end of the world.

I was thinking this might be a good candidate for a brew link operation, but I can’t find documentation on how to write that up in a formula. Any tips?

(Jacob Ledbetter) #4

Post an issue on the Homebrew GitHub with the tag help wanted.