Rename script/fetch-policy to script/commit-current-upstream-policy-docs
check / check (push) Canceled after 0s

sneak, on the PR: the script does more than fetch, and short names are
not wanted. The make target, the test names, the variables and the
messages take the new name. Behaviour is unchanged.

Model: opus-5-5
This commit is contained in:
clawbot committed 2026-11-11 00:00:28 +00:00
1 parent 917fe4bc1d
commit ed60414378
9 files changed
+145 -129

No files matched your search

@@ -1,10 +1,10 @@
#!/bin/sh
# script/fetch-policy: write the current policy files from the prompts
# repo into a repo clone, over HTTP. It commits nothing;
# script/update-policy does that. Identical in all repos. Our own
# extension to scripts-to-rule-them-all.
# script/commit-current-upstream-policy-docs: write the current policy
# files from the prompts repo into a repo clone, over HTTP. It commits
# nothing; script/update-policy does that. Identical in all repos. Our
# own extension to scripts-to-rule-them-all.
#
# Usage: script/fetch-policy [path of a repo clone]
# Usage: script/commit-current-upstream-policy-docs [path of a repo clone]
# Without a path it updates the repo this script sits in.
#
# Standard output is the full hash of the prompts commit, then each path
@@ -50,12 +50,12 @@ prompts/GO_HTTP_SERVER_CONVENTIONS.md
prompts/LLM_PROSE_TELLS.md
prompts/NEW_REPO_CHECKLIST.md
prompts/REPO_POLICIES.md
script/fetch-policy
script/commit-current-upstream-policy-docs
script/update-policy
"
die() {
echo "fetch-policy: $*" >&2
echo "commit-current-upstream-policy-docs: $*" >&2
exit 1
}
@@ -226,7 +226,8 @@ $own"
}
main() {
[ "$#" -le 1 ] || die "usage: script/fetch-policy [path of a repo clone]"
[ "$#" -le 1 ] ||
die "usage: script/commit-current-upstream-policy-docs [path of a repo clone]"
target="${1:-$(dirname "$0")/..}"
cd "$target" || die "no such directory: $target"
+9 -7
View File
@@ -1,12 +1,13 @@
#!/bin/sh
# script/update-policy: bring this repo up to standards. It fetches the
# current script/fetch-policy from the prompts repo over HTTP, runs it
# on this repo and commits the files it wrote. It does not push.
# Identical in all repos. Our own extension to scripts-to-rule-them-all.
# current script/commit-current-upstream-policy-docs from the prompts
# repo over HTTP, runs it on this repo and commits the files it wrote.
# It does not push. Identical in all repos. Our own extension to
# scripts-to-rule-them-all.
set -eu
ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
FETCH_POLICY_URL="https://git.eeqj.de/sneak/prompts/raw/branch/main/script/fetch-policy"
COMMIT_CURRENT_UPSTREAM_POLICY_DOCS_URL="https://git.eeqj.de/sneak/prompts/raw/branch/main/script/commit-current-upstream-policy-docs"
die() {
echo "update-policy: $*" >&2
@@ -22,10 +23,11 @@ main() {
trap 'rm -rf "$tmp"' EXIT
curl --fail --silent --show-error --max-time 60 \
--output "$tmp/fetch-policy" "$FETCH_POLICY_URL" ||
die "cannot fetch $FETCH_POLICY_URL"
--output "$tmp/commit-current-upstream-policy-docs" \
"$COMMIT_CURRENT_UPSTREAM_POLICY_DOCS_URL" ||
die "cannot fetch $COMMIT_CURRENT_UPSTREAM_POLICY_DOCS_URL"
sh "$tmp/fetch-policy" "$ROOT" > "$tmp/written"
sh "$tmp/commit-current-upstream-policy-docs" "$ROOT" > "$tmp/written"
commit="$(head -n 1 "$tmp/written")"
paths="$(tail -n +2 "$tmp/written")"