summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-06-11 13:53:07 +0000
committerbors <bors@rust-lang.org>2019-06-11 13:53:07 +0000
commitb8d59d699bed76b6be95d1ed41881d00d4b0d533 (patch)
tree2f8b193043491b70b88c31e6cdca2e18694d26f7
parent5586613eec345e6bf3bd47df8acc71c24766b70e (diff)
parent7a252c475551486efb52f949b8af55803b700bc6 (diff)
Auto merge of #169 - miller-time:fix-install-script, r=komaeda
fix(installation): Fix rustlings installation check fixes #147 I did some quick testing with the `-x` check: ```sh if [ -x "$(notrustlings)" ] then echo "notrustlings does not exist" else echo "notrustlings appears to exist!" notrustlings fi ``` which produced: ``` ./test.sh: line 12: notrustlings: command not found notrustlings appears to exist! ./test.sh: line 17: notrustlings: command not found ``` (consistent with comments in issue) Using `if ! [ -x "$(command -v <command>)" ]` appears to be the standard way to perform this type of check.
-rwxr-xr-xinstall.sh3
1 files changed, 1 insertions, 2 deletions
diff --git a/install.sh b/install.sh
index 18d2f53..9cd6048 100755
--- a/install.sh
+++ b/install.sh
@@ -94,10 +94,9 @@ git checkout -q tags/$Version
echo "Installing the 'rustlings' executable..."
cargo install --force --path .
-if [ -x "$(rustlings)" ]
+if ! [ -x "$(command -v rustlings)" ]
then
echo "WARNING: Please check that you have '~/.cargo/bin' in your PATH environment variable!"
fi
echo "All done! Run 'rustlings' to get started."
-