Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update .bashrc from provisioning shell script with Vagrant

I'm trying to add some additional lines to .bashrc in my home directory from the provisioning shell script when launching a new instance with Vagrant.

In the shell script I have:

set -x

sudo apt-get update

sudo apt-get install vim

echo "source /usr/local/share/chruby/chruby.sh">> ~/.bashrc
echo "source /usr/local/share/chruby/auto.sh">> ~/.bashrc

However after completion nothing has been written to .bashrc.

This is a cut down version of the full script the intention of which is to install Ruby/Rails.

like image 226
Grant Trevor Avatar asked Nov 19 '14 20:11

Grant Trevor


1 Answers

You need to give the full path to the file.

E.g.

echo "source /usr/local/share/chruby/chruby.sh" >> /home/vagrant/.bashrc
like image 73
Sirrah Avatar answered Oct 15 '22 11:10

Sirrah