Commits

Randy Stauner committed 28de899

Add an example to show how to customize vagrant prompt

  • Participants
  • Parent commits 699f3fb

Comments (0)

Files changed (1)

vagrant/prompt_example.rb

+Vagrant.configure('2') do |config|
+
+  # Use %q to avoid nested here-doc issue with vim-ruby syntax highlighting.
+  config.vm.provision :shell, :inline => %q!
+cat <<BASHRC > /home/vagrant/.bashrc.local
+# prompt
+PS1='\[\033[00;01m \u@\h:\w \033[00m\]\n\$ '
+BASHRC
+
+line="source /home/vagrant/.bashrc.local"
+file="/home/vagrant/.bashrc"
+grep -qFx "$line" "$file" || echo "$line" >> "$file"
+  !
+
+end