I have a command line tool (ngi) I made, and currently the process of installation requires 2 steps.
First step is to clone the repo into usr/local/ngi
.
Second step is to manually set the $PATH
in ~/.bash_profile
(or wherever they set their environment variables) so that they can run the tool from the command line.
What I'm considering instead is this (it will shorten the installation to just one step):
I plan to create an install
file in the repo, which is just a script that does the two steps above for the user. They now will be able to just open their command line and download the install script via curl
, which when run, will in turn install the command line tool:
curl https://raw.githubusercontent.com/joshbeam/angular_init/install >> install_ngi; ruby install_ngi
Basically the above command just downloads the raw content of the install
file from GitHub into a new local file called install_ngi
, and then runs it with Ruby. The install_ngi
file itself then clones the GitHub repo and sets the environment variables.
My question is, what are some safety concerns regarding this method, and is there a safer way to implement this sort of installation?