Show friendlier warnings when binaries don’t exist

Also, allow the --release flags to be passed to the build-exa and test-exa commands.
This commit is contained in:
Benjamin Sago 2017-10-02 10:22:50 +02:00
parent 9cfc70f4c0
commit 895808e945
3 changed files with 18 additions and 4 deletions

8
Vagrantfile vendored
View File

@ -63,13 +63,13 @@ Vagrant.configure(2) do |config|
config.vm.provision :shell, privileged: true, inline: <<-EOF
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
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
echo -e "#!/bin/sh\n/vagrant/xtests/run.sh" > /usr/bin/run-xtests

7
devtools/dev-run-debug.sh Executable file
View File

@ -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
devtools/dev-run-release.sh Executable file
View File

@ -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