Browse Source

Show friendlier warnings when binaries don’t exist

Also, allow the --release flags to be passed to the build-exa and test-exa commands.
Benjamin Sago 8 years ago
parent
commit
895808e945
3 changed files with 18 additions and 4 deletions
  1. 4 4
      Vagrantfile
  2. 7 0
      devtools/dev-run-debug.sh
  3. 7 0
      devtools/dev-run-release.sh

+ 4 - 4
Vagrantfile

@@ -63,13 +63,13 @@ Vagrant.configure(2) do |config|
     config.vm.provision :shell, privileged: true, inline: <<-EOF
     config.vm.provision :shell, privileged: true, inline: <<-EOF
       set -xe
       set -xe
 
 
-      echo -e "#!/bin/sh\n/home/#{developer}/target/debug/exa \"\\$*\"" > /usr/bin/exa
-      echo -e "#!/bin/sh\n/home/#{developer}/target/release/exa \"\\$*\"" > /usr/bin/rexa
+      ln -sf /vagrant/devtools/dev-run-debug.sh   /usr/bin/exa
+      ln -sf /vagrant/devtools/dev-run-release.sh /usr/bin/rexa
 
 
-      echo -e "#!/bin/sh\ncargo build --manifest-path /vagrant/Cargo.toml" > /usr/bin/build-exa
+      echo -e "#!/bin/sh\ncargo build --manifest-path /vagrant/Cargo.toml \\$@" > /usr/bin/build-exa
       ln -sf /usr/bin/build-exa /usr/bin/b
       ln -sf /usr/bin/build-exa /usr/bin/b
 
 
-      echo -e "#!/bin/sh\ncargo test --manifest-path /vagrant/Cargo.toml --lib -- --quiet" > /usr/bin/test-exa
+      echo -e "#!/bin/sh\ncargo test --manifest-path /vagrant/Cargo.toml --lib \\$@ -- --quiet" > /usr/bin/test-exa
       ln -sf /usr/bin/test-exa /usr/bin/t
       ln -sf /usr/bin/test-exa /usr/bin/t
 
 
       echo -e "#!/bin/sh\n/vagrant/xtests/run.sh" > /usr/bin/run-xtests
       echo -e "#!/bin/sh\n/vagrant/xtests/run.sh" > /usr/bin/run-xtests

+ 7 - 0
devtools/dev-run-debug.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+if [[ -f ~/target/debug/exa ]]; then
+  ~/target/debug/exa "$@"
+else
+  echo -e "Debug exa binary does not exist!"
+  echo -e "Run \033[32;1mb\033[0m or \033[32;1mbuild-exa\033[0m to create it"
+fi

+ 7 - 0
devtools/dev-run-release.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+if [[ -f ~/target/release/exa ]]; then
+  ~/target/release/exa "$@"
+else
+  echo -e "Release exa binary does not exist!"
+  echo -e "Run \033[32;1mb --release\033[0m or \033[32;1mbuild-exa --release\033[0m to create it"
+fi