Skip to content

Commit c9be3f3

Browse files
committed
hook
1 parent a8297fa commit c9be3f3

6 files changed

Lines changed: 62 additions & 18 deletions

File tree

.codex/hooks.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"hooks": {
3+
"PreToolUse": [
4+
{
5+
"matcher": "Bash",
6+
"hooks": [
7+
{
8+
"type": "command",
9+
"command": ".codex/hooks/block-dangerous-git.sh",
10+
"statusMessage": "Checking Git safety..."
11+
}
12+
]
13+
}
14+
],
15+
"PostToolUse": [
16+
{
17+
"matcher": "Edit|Write",
18+
"hooks": [
19+
{
20+
"type": "command",
21+
"command": "pnpm run format",
22+
"statusMessage": "Running format",
23+
"timeout": 120
24+
}
25+
]
26+
}
27+
]
28+
}
29+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
# .codex/hooks/block-dangerous-git.sh
3+
4+
INPUT=$(cat)
5+
COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty')
6+
BRANCH=$(git branch --show-current 2>/dev/null)
7+
# Only enforce on main/master
8+
if [[ "$BRANCH" != "main" && "$BRANCH" != "master" ]]; then
9+
exit 0
10+
fi
11+
DANGEROUS_PATTERNS=(
12+
"git push --force"
13+
"git push -f"
14+
"git reset --hard"
15+
"git clean -f"
16+
"git checkout -- ."
17+
)
18+
for pattern in "${DANGEROUS_PATTERNS[@]}"; do
19+
if echo "$COMMAND" | grep -q "$pattern"; then
20+
echo "Blocked: '$pattern' is not allowed on $BRANCH. Create a feature branch first." >&2
21+
exit 2
22+
fi
23+
done
24+
exit 0

.frontmatter/database/mediaDb.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

.frontmatter/database/pinnedItemsDb.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

.frontmatter/database/taxonomyDb.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

app/pages/case-study/[...slug].vue

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -176,17 +176,15 @@ onMounted(() => {
176176
ease: "circ.out",
177177
});
178178
179-
tl
180-
?.fromTo(
181-
titles.value?.children,
182-
{ opacity: 0 },
183-
{ opacity: 1, duration: 0.3, stagger: 0.12 },
184-
)
185-
.to(
186-
Array.from(titles.value?.children).slice(0, -1),
187-
{ opacity: 0, duration: 0.15, y: -1, stagger: 0.1 },
188-
0.35,
189-
);
179+
tl?.fromTo(
180+
titles.value?.children,
181+
{ opacity: 0 },
182+
{ opacity: 1, duration: 0.3, stagger: 0.12 },
183+
).to(
184+
Array.from(titles.value?.children).slice(0, -1),
185+
{ opacity: 0, duration: 0.15, y: -1, stagger: 0.1 },
186+
0.35,
187+
);
190188
191189
titleEffect = new IntersectionObserver(([entry]) => {
192190
if (entry.isIntersecting) {

0 commit comments

Comments
 (0)