From 7303bc3e34b4a29df3861d25f940f7a6c011c2f5 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Fri, 11 Aug 2023 23:17:50 -0700 Subject: [PATCH] Use cog prolog Refs https://github.com/simonw/llm/issues/151#issuecomment-1675730608 --- .github/workflows/test.yml | 5 +++-- Justfile | 2 +- docs/aliases.md | 3 --- docs/help.md | 2 -- docs/usage.md | 4 ---- 5 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ed9d26b..bd159f2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,8 +27,9 @@ jobs: pytest - name: Check if cog needs to be run run: | - cog docs/usage.md - cog --check docs/*.md + cog --check \ + -p "import sys, os; sys._called_from_test=True; os.environ['LLM_USER_PATH'] = '/tmp'" \ + docs/*.md - name: Run Black run: | black --check . diff --git a/Justfile b/Justfile index d83f403..ba2f05f 100644 --- a/Justfile +++ b/Justfile @@ -23,7 +23,7 @@ # Rebuild docs with cog @cog: - pipenv run cog -r docs/*.md + pipenv run cog -r -p "import sys, os; sys._called_from_test=True; os.environ['LLM_USER_PATH'] = '/tmp'" docs/*.md # Serve live docs on localhost:8000 @docs: cog diff --git a/docs/aliases.md b/docs/aliases.md index 869dd78..d3ef1b4 100644 --- a/docs/aliases.md +++ b/docs/aliases.md @@ -12,9 +12,6 @@ Example output: ```