How many times have you seen a repo with a custom RC installer of .bashrc or .zshrc files? Repos with a file, like these:

Examples are numerous, since everyone is reinventing a wheel. I have done it once or twice. So eventually, I have decided to write my own “nano-framework” that solves exactly this problem and that can be used with any config out there. Here is how the README.md for my config repo looks like:

In order to install config please do: cd /tmp

git clone https://github.com/OwnInfrastructure/configs.git

cd configs

RC_PATH=.commonrc

curl -s https://raw.githubusercontent.com/b0noI/rcinstaller/master/install.sh | bash /dev/stdin $RC_PATH

The main line that I want to bring to your attention is the following:

curl -s https://raw.githubusercontent.com/b0noI/rcinstaller/master/install.sh | bash /dev/stdin $RC_PATH

This is the example of a usage of the “rcinstaller”, the “nano-framework” that installs script to the .bashrc and/or .zshrc. The home repo of the framework is here.

Now anyone can just create a config repo with configs and use this framework in a README file to describe the installation without re-implementing the wheel.

How I Can Use It?

It is simple, just add something like the following to your README file:

How Does the “rcinstaller” Work?

Overall, the script executes the following steps:

checks if the ~/.profile.d directory exists and if not — created it; adds “[ -f ${HOME}/.profile.d/.sh ] && source ${HOME}/.profile.d/.sh” to the .zshrc (if it is not exists there already); same for the .bashrc; copies the rc file from the input (or .commonrc if there is no input) from the current directory to the: ~/.profile.d.

Currently, it requires your rc files to have a unique name. This is needed simply because the script will overwrite whatever is in the file with the same name. Also, it works only with one input script at a time.

How I Can Help?

If you would like to help, there are some feature requests and issues that need to be implemented, any help would be highly appreciated. You can add a star to the repo as well, or just share the article with your friends.

Also I have the Patreon page;)