You do it by updating the PATH
variable.
export PATH=$HOME/.composer/vendor/bin:$PATH
However, this will not persist. If you close the terminal window, the PATH
will be restored to its original value. You need to add this line to your ~/.bash_profile
Run this command to add the line to your ~/bash_profile
echo 'export PATH=$HOME/.composer/vendor/bin:$PATH' >> ~/.bash_profile
To verify that you have the correct path: echo $PATH
, and you should see .composer/vendor/bin
in the middle of the output
For spark specifically, you need to add the path to the location where you cloned the repo.
echo 'export PATH=path/to/spark/repo:$PATH' >> ~/.bash_profile
Here is a full list of commands to install Spark:
cd $HOME
git clone https://github.com/laravel/spark-installer.git
echo 'export PATH=$HOME/spark-installer:$PATH' >> ~/.bash_profile
source ~/.bash_profile
cd ~/spark-installer
composer install
spark