#!/bin/sh
# Diffron prepare-commit-msg hook wrapper for Windows (Git Bash)
# This file should be placed in .git/hooks/prepare-commit-msg (no extension)

# Get the directory where this wrapper script is located (Unix-style path)
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"

# Convert Unix path to Windows path for Python using cygpath
# Git Bash on Windows uses /d/... but Windows needs D:\...
PYTHON_SCRIPT="$(cygpath -w "$SCRIPT_DIR/prepare-commit-msg.py" 2>/dev/null || echo "$SCRIPT_DIR/prepare-commit-msg.py")"

# Run the Python script
python "$PYTHON_SCRIPT" "$1" "$2"
