-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpre-commit
More file actions
executable file
·25 lines (23 loc) · 818 Bytes
/
Copy pathpre-commit
File metadata and controls
executable file
·25 lines (23 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
#
# The hook should exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
if git diff --cached --quiet -- "ibidem/advent_of_code/y*"; then
echo "No changes to solutions"
else
echo "New/updated solutions"
# Add new data files to git secret
git secret add ibidem/advent_of_code/*/data/*.txt
if git diff --cached --quiet -- "ibidem/advent_of_code/y*/data/*"; then
# Hide modified secret files
git secret hide -m 1>&2
# Add secret files to commit
git add ibidem/advent_of_code/*/data/ .gitsecret .gitignore
fi
# Generate AoC tiles and update README.rst
uv run python AoCTiles/create_aoc_tiles.py 1>&2
# Add generated tiles and README to commit
git add Media README.rst
fi