Skip to content

Commit b8d59d6

Browse files
committed
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.
2 parents 5586613 + 7a252c4 commit b8d59d6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

install.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,9 @@ git checkout -q tags/$Version
9494
echo "Installing the 'rustlings' executable..."
9595
cargo install --force --path .
9696

97-
if [ -x "$(rustlings)" ]
97+
if ! [ -x "$(command -v rustlings)" ]
9898
then
9999
echo "WARNING: Please check that you have '~/.cargo/bin' in your PATH environment variable!"
100100
fi
101101

102102
echo "All done! Run 'rustlings' to get started."
103-

0 commit comments

Comments
 (0)