Skip to content

Commit c71b349

Browse files
committed
fix: repin opencode submodule and validate staged gitlink
1 parent 7e2262b commit c71b349

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

.githooks/pre-commit

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@ set -euo pipefail
66
# Note: cli-node has package-specific README (passthrough wrapper docs)
77

88
ROOT_README="README.md"
9+
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
910

1011
# Guard against unpublished opencode submodule pins.
11-
if git diff --cached --name-only --diff-filter=ACMR | rg -q '^packages/opencode$'; then
12-
./scripts/check-opencode-submodule-published.sh --from-index
12+
if git -C "$REPO_ROOT" diff --cached --name-only --diff-filter=ACMR | rg -q '^packages/opencode$'; then
13+
"$REPO_ROOT"/scripts/check-opencode-submodule-published.sh --from-index
1314
fi
1415

15-
if [[ -f "$ROOT_README" ]]; then
16-
cp "$ROOT_README" packages/core/README.md
17-
git add packages/core/README.md
16+
if [[ -f "$REPO_ROOT/$ROOT_README" ]]; then
17+
cp "$REPO_ROOT/$ROOT_README" "$REPO_ROOT/packages/core/README.md"
18+
git -C "$REPO_ROOT" add packages/core/README.md
1819
fi
1920

2021
# Run cfn-lint when CloudFormation templates change.
21-
if git diff --cached --name-only --diff-filter=ACMR | rg -q '^infra/aws/cloudformation/.*\.(ya?ml)$'; then
22-
cfn-lint infra/aws/cloudformation/*.yaml
22+
if git -C "$REPO_ROOT" diff --cached --name-only --diff-filter=ACMR | rg -q '^infra/aws/cloudformation/.*\.(ya?ml)$'; then
23+
cfn-lint "$REPO_ROOT"/infra/aws/cloudformation/*.yaml
2324
fi

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ check-opencode-submodule-drift:
151151

152152
# Ensure pinned opencode submodule commit is remotely fetchable
153153
check-opencode-submodule-published:
154-
./scripts/check-opencode-submodule-published.sh
154+
./scripts/check-opencode-submodule-published.sh --from-index
155155

156156
# Update opencode submodule + Dockerfile OPENCODE_COMMIT pin
157157
update-opencode-commit:

0 commit comments

Comments
 (0)