cli-setup-wizard: explain why SSH/GPG key setup got skipped
The SSH/GPG key-generation question only fires when gh/tea are actually logged in (DID_GITHUB/DID_GITEA), which is correct - but if login was declined, failed, or never completed, the section was skipped with zero explanation. From the user's side that looked like a missing feature rather than an unfinished login. Confirmed on a live workspace: gh was never installed, and tea was installed but `tea login add` never actually completed (no ~/.config/tea/config.yml), so the gate correctly stayed closed - the user just had no way to know why. Now prints a one-line hint (only when gh or tea is installed at all) pointing at the login command and the --force re-run.
This commit is contained in:
@@ -237,6 +237,12 @@ if [ "$DID_GITHUB" -eq 1 ] || [ "$DID_GITEA" -eq 1 ]; then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
elif command -v gh >/dev/null 2>&1 || command -v tea >/dev/null 2>&1; then
|
||||
# gh and/or tea are installed but neither is actually logged in yet (login
|
||||
# was declined, failed, or never completed) - say why the key-generation
|
||||
# question above got skipped instead of just silently not asking.
|
||||
echo "Skipping SSH/GPG key setup: not logged in to GitHub or Gitea yet."
|
||||
echo "Log in (gh auth login / tea login add) then re-run: bash /opt/coder/cli-setup-wizard.sh --force"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
@@ -237,6 +237,12 @@ if [ "$DID_GITHUB" -eq 1 ] || [ "$DID_GITEA" -eq 1 ]; then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
elif command -v gh >/dev/null 2>&1 || command -v tea >/dev/null 2>&1; then
|
||||
# gh and/or tea are installed but neither is actually logged in yet (login
|
||||
# was declined, failed, or never completed) - say why the key-generation
|
||||
# question above got skipped instead of just silently not asking.
|
||||
echo "Skipping SSH/GPG key setup: not logged in to GitHub or Gitea yet."
|
||||
echo "Log in (gh auth login / tea login add) then re-run: bash /opt/coder/cli-setup-wizard.sh --force"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
@@ -237,6 +237,12 @@ if [ "$DID_GITHUB" -eq 1 ] || [ "$DID_GITEA" -eq 1 ]; then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
elif command -v gh >/dev/null 2>&1 || command -v tea >/dev/null 2>&1; then
|
||||
# gh and/or tea are installed but neither is actually logged in yet (login
|
||||
# was declined, failed, or never completed) - say why the key-generation
|
||||
# question above got skipped instead of just silently not asking.
|
||||
echo "Skipping SSH/GPG key setup: not logged in to GitHub or Gitea yet."
|
||||
echo "Log in (gh auth login / tea login add) then re-run: bash /opt/coder/cli-setup-wizard.sh --force"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
@@ -237,6 +237,12 @@ if [ "$DID_GITHUB" -eq 1 ] || [ "$DID_GITEA" -eq 1 ]; then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
elif command -v gh >/dev/null 2>&1 || command -v tea >/dev/null 2>&1; then
|
||||
# gh and/or tea are installed but neither is actually logged in yet (login
|
||||
# was declined, failed, or never completed) - say why the key-generation
|
||||
# question above got skipped instead of just silently not asking.
|
||||
echo "Skipping SSH/GPG key setup: not logged in to GitHub or Gitea yet."
|
||||
echo "Log in (gh auth login / tea login add) then re-run: bash /opt/coder/cli-setup-wizard.sh --force"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
@@ -237,6 +237,12 @@ if [ "$DID_GITHUB" -eq 1 ] || [ "$DID_GITEA" -eq 1 ]; then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
elif command -v gh >/dev/null 2>&1 || command -v tea >/dev/null 2>&1; then
|
||||
# gh and/or tea are installed but neither is actually logged in yet (login
|
||||
# was declined, failed, or never completed) - say why the key-generation
|
||||
# question above got skipped instead of just silently not asking.
|
||||
echo "Skipping SSH/GPG key setup: not logged in to GitHub or Gitea yet."
|
||||
echo "Log in (gh auth login / tea login add) then re-run: bash /opt/coder/cli-setup-wizard.sh --force"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
@@ -237,6 +237,12 @@ if [ "$DID_GITHUB" -eq 1 ] || [ "$DID_GITEA" -eq 1 ]; then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
elif command -v gh >/dev/null 2>&1 || command -v tea >/dev/null 2>&1; then
|
||||
# gh and/or tea are installed but neither is actually logged in yet (login
|
||||
# was declined, failed, or never completed) - say why the key-generation
|
||||
# question above got skipped instead of just silently not asking.
|
||||
echo "Skipping SSH/GPG key setup: not logged in to GitHub or Gitea yet."
|
||||
echo "Log in (gh auth login / tea login add) then re-run: bash /opt/coder/cli-setup-wizard.sh --force"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user