anishathalye / dotbot

A tool that bootstraps your dotfiles ⚡️
MIT License
6.91k stars 288 forks source link

Append file to dotfiles that already exist. #264

Closed deeperlearner closed 3 years ago

deeperlearner commented 3 years ago

I'm not sure if this has been made. Consider the condition: The system already has a ~/.bashrc file and I don't want to overwrite it. I have my own .my_bashrc. After ./install, ~/.my_bashrc has linked to .my_bashrc. But I need to add one line to ~/.bashrc manually: source ~/.my_bashrc

Is there any way to do this automatically with dotbot?

anishathalye commented 3 years ago

No, there is no "append" functionality built-in to Dotbot. It's a bit tricky to get it to be idempotent.

You can do it by writing a separate shell script, and then calling that shell script from your install.conf.yaml using a shell:. See here for an example of how to implement "add this line if it doesn't exist".