Browse Source

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.
Benjamin Sago 8 years ago
parent
commit
b5bd76b548
1 changed files with 9 additions and 2 deletions
  1. 9 2
      Vagrantfile

+ 9 - 2
Vagrantfile

@@ -38,8 +38,15 @@ Vagrant.configure(2) do |config|
     # By default it just uses the one in /vagrant/target, which can
     # By default it just uses the one in /vagrant/target, which can
     # cause problems if it has different permissions than the other
     # cause problems if it has different permissions than the other
     # directories, or contains object files compiled for the host.
     # 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.
     # We create two users that own the test files.