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 /tmpgit clone https://github.com/OwnInfrastructure/configs.gitcd configsRC_PATH=.commonrccurl -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.
It is simple, just add something like the following to your README file:
curl -s https://raw.githubusercontent.com/b0noI/rcinstaller/master/install.sh | bash /dev/stdin <path_to_my_awesome_rc_file>
Overall, the script executes the following steps:
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.
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;)