char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
6ea215d17
char/aliceai-t5-moe
1#!/usr/bin/env bash 2# 3# Pre-push hook for llama-ui 4# Runs: lint + test 5# Ignores unstaged changes (stashes them temporarily and restores after). 6 7needs_check =false 8 9# Read refs from stdin: local_ref local_sha remote_ref remote_sha 10while read local_ref local_sha remote_ref remote_sha;do 11# New branch or force-push — always check 12if [" $ local_sha " ="0000000000000000000000000000000000000000" ] || \ 13 [" $ remote_sha " ="0000000000000000000000000000000000000000" ];then 14needs_check =true 15continue 16fi 17 18# Check for changes in tools/ui/ between remote and local 19if git diff--name-only " $ remote_sha ... $ local_sha " -- tools/ui/| grep -q .;then 20needs_check =true 21fi 22done 23 24if [" $ needs_check " = false ];then 25exit 0 26fi 27 28REPO_ROOT =$( git rev-parse --show-toplevel ) 29cd " $ REPO_ROOT /tools/ui" 30 31# Check that node_modules exists 32if [ ! -d"node_modules" ];then 33echo "❌ node_modules not found. Run 'npm ci' first." 34exit 1 35fi 36 37# Stash unstaged changes so they don't interfere with checks 38stash_name ="pi-ui-prepush" 39git stash push-u -m " $ stash_name " -- tools/ui/2 > /dev/null ||true 40 41echo "Running pre-push checks for llama-ui..." 42 43# Lint 44npm run lint 45lint_ok =$ ? 46 47# Test 48npm test 49test_ok =$ ? 50 51# Restore stashed changes 52if git stash list| grep -q " $ stash_name " ;then 53git stash pop2 > /dev/null ||true 54fi 55 56if [$ lint_ok -ne 0 ];then 57echo "❌ Lint failed" 58exit 1 59fi 60 61if [$ test_ok -ne 0 ];then 62echo "❌ Tests failed" 63exit 1 64fi 65 66echo "✅ Pre-push checks passed" 67exit 0