Give everybody dexa and rexa aliases

Also, make it so the same line doesn’t get added to the .bashrc every time provisioning is run.
This commit is contained in:
Benjamin Sago 2017-05-06 19:07:29 +01:00
parent 1546994313
commit b5bd76b548

11
Vagrantfile vendored
View File

@ -38,8 +38,15 @@ Vagrant.configure(2) do |config|
# By default it just uses the one in /vagrant/target, which can
# cause problems if it has different permissions than the other
# directories, or contains object files compiled for the host.
config.vm.provision :shell, privileged: false, inline:
%[echo "export CARGO_TARGET_DIR=/home/ubuntu/target" >> ~/.bashrc]
config.vm.provision :shell, privileged: false, inline: <<-EOF
function put_line() {
grep -q -F "$2" $1 || echo "$2" >> $1
}
put_line ~/.bashrc 'export CARGO_TARGET_DIR=/home/ubuntu/target'
put_line ~/.bashrc 'alias dexa=~/target/debug/exa'
put_line ~/.bashrc 'alias rexa=~/target/release/exa'
EOF
# We create two users that own the test files.