Skip to content

Commit ef555ce

Browse files
committed
fix(setup): improve SSH clone error handling and user prompts
1 parent e928ae2 commit ef555ce

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

scripts/setup.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,17 @@ setup_repo() {
3636
else
3737
if [[ ! -d "$PWD/bitbots_main" ]]; then
3838
echo "Cloning repository bitbots_main..."
39-
# Try to clone via SSH first, fall back to HTTPS if that fails
39+
# Try to clone via SSH first. If it fails, warn and ask user how to proceed.
4040
if ! git clone "$REPO_URL_SSH"; then
41-
echo "SSH clone failed, trying HTTPS..."
42-
git clone "$REPO_URL_HTTPS"
41+
echo "SSH clone failed. This may mean your SSH keys are not set up for GitHub."
42+
echo "See: https://docs.github.com/en/authentication/connecting-to-github-with-ssh"
43+
if ask_question "Do you want to continue with an HTTPS clone instead of fixing SSH keys now?"; then
44+
echo "Cloning via HTTPS..."
45+
git clone "$REPO_URL_HTTPS"
46+
else
47+
echo "Please set up your SSH keys and re-run this script. Exiting."
48+
exit 1
49+
fi
4350
fi
4451
git checkout "$BRANCH"
4552
fi

0 commit comments

Comments
 (0)