From caa5bed18926291e39f825aa0f04f26e3a5bd9fe Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Fri, 10 Jul 2026 03:17:06 +0200 Subject: [PATCH] fix(seo-data): source ~/.claude/.env in make seo-connect so OAuth creds reach connect.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The seo-connect target ran connect.py without sourcing ~/.claude/.env, so GOOGLE_OAUTH_CLIENT_ID/SECRET (documented to live there) never reached os.environ — connect.py aborted telling the user to set what they had set. Mirror fetch.sh's sourcing; add a regression lock. --- Makefile | 3 ++- lib/seo-data/seo-data.test.sh | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7d8d1da..8e04472 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,8 @@ onboard: link ## Onboard an existing project (run from the project directory) seo-connect: ## Connect a Google account for /seo FULL (creates venv, OAuth consent) @python3 -m venv "$$HOME/.claude/.venv-seo-data" @"$$HOME/.claude/.venv-seo-data/bin/pip" install -q -r lib/seo-data/requirements.txt - @bash -c 'read -r -p "Label for this account (e.g. client-a): " label; \ + @bash -c 'set -a; [ -f "$$HOME/.claude/.env" ] && . "$$HOME/.claude/.env"; set +a; \ + read -r -p "Label for this account (e.g. client-a): " label; \ "$$HOME/.claude/.venv-seo-data/bin/python3" lib/seo-data/connect.py --label "$$label"' test: ## Run deterministic tests (lib/tests/*.test.sh + lib/gitflow-test.sh + lib/tests/run-*.sh) diff --git a/lib/seo-data/seo-data.test.sh b/lib/seo-data/seo-data.test.sh index 4efc1b5..7e9a068 100644 --- a/lib/seo-data/seo-data.test.sh +++ b/lib/seo-data/seo-data.test.sh @@ -111,6 +111,7 @@ tf() { if grep -qF -- "$3" "$2" 2>/dev/null; then ok "$1"; else no "$1" "missing tf "env.example client id" "$REPO/.env.example" "GOOGLE_OAUTH_CLIENT_ID=" tf "env.example crux key" "$REPO/.env.example" "CRUX_API_KEY=" tf "makefile seo-connect" "$REPO/Makefile" "seo-connect:" +tf "seo-connect sources env" "$REPO/Makefile" ".claude/.env" tf "makefile discovers test" "$REPO/Makefile" "lib/seo-data/*.test.sh" tf "install prompts connect" "$REPO/install.sh" "make seo-connect" tf "doctor checks seo-data" "$REPO/doctor.sh" "seo-data"