char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Aleksander Grygierui: Improve Git Hooks for UI development (#23403)5e932a1c8

char/aliceai-t5-moe
986 B35 linesraw
1#!/usr/bin/env bash
2#
3# Install git hooks for llama-ui
4# Copies pre-commit and pre-push hooks into the repo's .git/hooks directory.
5
6SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
7REPO_ROOT="$(cd "$SCRIPT_DIR/../../../.." && pwd)"
8HOOKS_DIR="$REPO_ROOT/$(cd "$REPO_ROOT" && git rev-parse --git-path hooks)"
9
10# Verify package.json exists
11if [ ! -f "$REPO_ROOT/tools/ui/package.json" ]; then
12    echo "❌ package.json not found in tools/ui"
13    exit 1
14fi
15
16echo "Installing git hooks for llama-ui..."
17
18for hook in pre-commit pre-push; do
19    src="$SCRIPT_DIR/${hook}.sh"
20    dst="$HOOKS_DIR/$hook"
21
22    if cp "$src" "$dst" && chmod +x "$dst"; then
23        echo "  ✅ $hook"
24    else
25        echo "  ❌ Failed to install $hook"
26        exit 1
27    fi
28done
29
30echo ""
31echo "Pre-commit:  format (staged) + type-check"
32echo "Pre-push:    lint + test"
33echo ""
34echo "Hooks stash unstaged changes temporarily and restore them after."
35echo "Skip with:  git commit --no-verify / git push --no-verify"