Improve error message with rustup not found (#1659)

* Improve error message with rustup not found

* Improve error message with rustup not found on the mobile devices

* Fix `err` function in setup.sh

Fix `err` function printing repeated error lines

---------

Co-authored-by: Vítor Vasconcellos <vasconcellos.dev@gmail.com>
This commit is contained in:
devqore 2023-10-22 17:42:37 +02:00 committed by GitHub
parent 4c785eaca0
commit 5b09c615c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,7 +8,7 @@ fi
err() {
for _line in "$@"; do
echo "$@" >&2
echo "$_line" >&2
done
exit 1
}
@ -52,7 +52,7 @@ if [ "${CI:-}" != "true" ]; then
'https://pnpm.io/installation'
fi
if ! has rustup rustc cargo; then
if ! has rustc cargo; then
err 'Rust was not found.' \
"Ensure the 'rustc' and 'cargo' binaries are in your \$PATH." \
'https://rustup.rs'
@ -74,6 +74,12 @@ if [ "${1:-}" = "mobile" ]; then
"Ensure 'python3' is available in your \$PATH and try again."
fi
if ! has rustup; then
err 'Rustup was not found. It is required for cross-compiling rust to mobile targets.' \
"Ensure the 'rustup' binary is in your \$PATH." \
'https://rustup.rs'
fi
# Android targets
echo "Installing Android targets for Rust..."