Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(installer): always check for cargo install first #1610

Merged
merged 5 commits into from Feb 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
44 changes: 22 additions & 22 deletions install.sh
Expand Up @@ -144,11 +144,11 @@ _install_rust_and_cargo() {
*) echo "Please answer yes or no." ;;
esac
done
echo "rustup installed! Installing with cargo"
_install_cargo
echo "rustup installed!"
jonaro00 marked this conversation as resolved.
Show resolved Hide resolved
}

_install_cargo() {
_install_with_cargo() {
echo "Installing with cargo..."
cargo install --locked cargo-shuttle
}

Expand All @@ -164,36 +164,36 @@ _install_unsupported() {
if ! command -v cargo &>/dev/null; then
if ! command -v rustup &>/dev/null; then
_install_rust_and_cargo
_install_with_cargo
jonaro00 marked this conversation as resolved.
Show resolved Hide resolved
return 0
else
echo "rustup was found, but cargo wasn't. Something is up with your install"
exit 1
fi
else
while true; do
fi
fi

while true; do
read -r -p "Do you wish to attempt to install the pre-built binary? [Y/N] " yn </dev/tty
case $yn in
[Yy]*)
echo "Installing pre-built binary..."
_install_binary
break
;;
[Nn]*)
read -r -p "Do you wish to attempt an install with cargo? [Y/N] " yn </dev/tty
case $yn in
[Yy]*)
echo "Installing with cargo..."
_install_cargo
_install_with_cargo
break
;;
[Nn]*)
read -r -p "Do you wish to attempt to install the pre-built binary? [Y/N] " yn </dev/tty
case $yn in
[Yy]*)
echo "Installing pre-built binary..."
_install_binary
break
;;
[Nn]*) exit ;;
*) echo "Please answer yes or no." ;;
esac
;;
[Nn]*) exit ;;
*) echo "Please answer yes or no." ;;
esac
done
fi
;;
*) echo "Please answer yes or no." ;;
esac
done
}

if command -v cargo-shuttle &>/dev/null; then
Expand Down