diff --git a/templates/3d-printing/cli-setup-wizard.sh b/templates/3d-printing/cli-setup-wizard.sh index 6cb3804..91de88e 100644 --- a/templates/3d-printing/cli-setup-wizard.sh +++ b/templates/3d-printing/cli-setup-wizard.sh @@ -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 "" diff --git a/templates/cobol/cli-setup-wizard.sh b/templates/cobol/cli-setup-wizard.sh index 6cb3804..91de88e 100644 --- a/templates/cobol/cli-setup-wizard.sh +++ b/templates/cobol/cli-setup-wizard.sh @@ -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 "" diff --git a/templates/default/cli-setup-wizard.sh b/templates/default/cli-setup-wizard.sh index 6cb3804..91de88e 100644 --- a/templates/default/cli-setup-wizard.sh +++ b/templates/default/cli-setup-wizard.sh @@ -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 "" diff --git a/templates/python/cli-setup-wizard.sh b/templates/python/cli-setup-wizard.sh index 6cb3804..91de88e 100644 --- a/templates/python/cli-setup-wizard.sh +++ b/templates/python/cli-setup-wizard.sh @@ -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 "" diff --git a/templates/ttrpg/cli-setup-wizard.sh b/templates/ttrpg/cli-setup-wizard.sh index 6cb3804..91de88e 100644 --- a/templates/ttrpg/cli-setup-wizard.sh +++ b/templates/ttrpg/cli-setup-wizard.sh @@ -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 "" diff --git a/templates/web/cli-setup-wizard.sh b/templates/web/cli-setup-wizard.sh index 6cb3804..91de88e 100644 --- a/templates/web/cli-setup-wizard.sh +++ b/templates/web/cli-setup-wizard.sh @@ -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 ""