Skip to content

Commit fc64928

Browse files
Update tree handling, READMEs
1 parent 08ff074 commit fc64928

4 files changed

Lines changed: 57 additions & 55 deletions

File tree

.github/workflows/directory-tree.yml

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

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ but has now been made more generic.
77
Recommendations for settings to change are always welcome,
88
so feel free to send in a [pull request](https://github.com/LightArrowsEXE/dotfiles/pulls).
99

10+
## Hooks
11+
12+
See [hooks/README.md](hooks/README.md) for more information.
13+
1014
## License
1115

1216
My custom configuration files (like `mpv.conf`) are licensed under MIT,

hooks/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Git Hooks
2+
3+
This directory contains Git hooks used in the repository to automate various tasks.
4+
5+
## Installing Hooks
6+
7+
To install these hooks:
8+
9+
1. Make sure the hook files are executable:
10+
11+
```bash
12+
chmod +x hooks/*
13+
```
14+
15+
2. Copy or symlink the hooks to your `.git/hooks` directory:
16+
17+
```bash
18+
# Option 1: Copy hooks
19+
cp hooks/* .git/hooks/
20+
21+
# Option 2: Symlink hooks (recommended)
22+
# First create the hooks directory if it doesn't exist
23+
mkdir -p .git/hooks
24+
25+
# Then create symlinks for each hook file
26+
for hook in hooks/*; do
27+
ln -s "../../$hook" ".git/hooks/$(basename $hook)"
28+
done
29+
```

hooks/pre-commit

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
# Function to generate tree for a directory
4+
generate_tree() {
5+
local dir=$1
6+
local output_file="$dir/TREE.md"
7+
echo "# $dir Directory Structure" > "$output_file"
8+
echo "" >> "$output_file"
9+
echo "Last updated: $(date)" >> "$output_file"
10+
echo "" >> "$output_file"
11+
echo '```' >> "$output_file"
12+
find "$dir" -not -path '*/\.*' | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/" >> "$output_file"
13+
echo '```' >> "$output_file"
14+
}
15+
16+
# List of directories to process
17+
directories=("VapourSynth")
18+
19+
# Generate trees for each directory
20+
for dir in "${directories[@]}"; do
21+
if [ -d "$dir" ]; then
22+
generate_tree "$dir"
23+
fi
24+
done

0 commit comments

Comments
 (0)