File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,4 +11,4 @@ install-hook:
1111 curl -fsSL https://raw.githubusercontent.com/inem/dotdotdot/main/install.sh | sh
1212
1313build :
14- go build -o _git/hooks /commit-msg-go commit-msg.go
14+ go build -o release /commit-msg-go commit-msg.go
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ This repository includes a custom Git commit message hook powered by OpenAI. The
1515## Quick Install
1616
1717``` sh
18- curl -fsSL https://raw.githubusercontent.com/inem/dotdotdot/refs/heads/ main/install.sh | sh
18+ curl -fsSL https://raw.githubusercontent.com/inem/dotdotdot/main/install.sh | sh
1919```
2020
2121## Manual Installation (Go version)
@@ -25,10 +25,11 @@ curl -fsSL https://raw.githubusercontent.com/inem/dotdotdot/refs/heads/main/inst
2525 ``` bash
2626 make build
2727 ```
28- 3 . Install the hook (this will overwrite ` .git/hooks/commit-msg ` ):
28+ 3 . Install the hook and binary (this will overwrite ` .git/hooks/commit-msg ` and ` .git/hooks/commit-msg-go ` ):
2929 ``` bash
3030 cp _git/hooks/commit-msg .git/hooks/commit-msg
31- chmod +x .git/hooks/commit-msg
31+ cp release/commit-msg-go .git/hooks/commit-msg-go
32+ chmod +x .git/hooks/commit-msg .git/hooks/commit-msg-go
3233 ```
33344 . Set your OpenAI API key in the environment:
3435 ``` bash
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ # Git commit-msg hook (Go version)
3+
4+ HOOK_BIN=" $( dirname " $0 " ) /commit-msg-go"
5+
6+ if [ ! -x " $HOOK_BIN " ]; then
7+ echo " commit-msg-go binary not found or not executable: $HOOK_BIN " >&2
8+ exit 1
9+ fi
10+
11+ exec " $HOOK_BIN " " $@ "
Original file line number Diff line number Diff line change 22set -e
33
44HOOK_PATH=" .git/hooks/commit-msg"
5- REPO_URL=" https://raw.githubusercontent.com/inem/dotdotdot/refs/heads/main/_git/hooks/commit-msg-go"
5+ BIN_PATH=" .git/hooks/commit-msg-go"
6+ SCRIPT_SRC=" _git/hooks/commit-msg"
7+ BIN_SRC=" release/commit-msg-go"
68
79if [ ! -d .git/hooks ]; then
810 echo " Error: .git/hooks directory not found. Please run this script from the root of your git repository."
911 exit 1
1012fi
1113
12- echo " Downloading commit_msg hook..."
13- curl -fsSL " $REPO_URL " -o " $HOOK_PATH "
14+ echo " Installing shell wrapper hook..."
15+ cp " $SCRIPT_SRC " " $HOOK_PATH "
1416chmod +x " $HOOK_PATH "
1517echo " Hook installed to $HOOK_PATH "
1618
19+ echo " Copying Go binary to .git/hooks..."
20+ cp " $BIN_SRC " " $BIN_PATH "
21+ chmod +x " $BIN_PATH "
22+ echo " Binary installed to $BIN_PATH "
23+
1724if [ -z " $OPENAI_API_KEY " ]; then
1825 echo " WARNING: OPENAI_API_KEY is not set. Please export it in your shell."
1926fi
File renamed without changes.
You can’t perform that action at this time.
0 commit comments