Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions installation-samples/install-global/verify-aikido-hook.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env pwsh

$ErrorActionPreference = "Stop"

# Check if core.hooksPath is set
$hooksPath = git config --global core.hooksPath 2>$null

if (-not $hooksPath) {
Write-Host "❌ core.hooksPath is not set" -ForegroundColor Red
exit 1
}

Write-Host "✅ core.hooksPath is set to: $hooksPath" -ForegroundColor Green

# Check if pre-commit hook exists
$hookScript = Join-Path $hooksPath "pre-commit"
if (-not (Test-Path $hookScript)) {
Write-Host "❌ Pre-commit hook file not found at: $hookScript" -ForegroundColor Red
exit 1
}

# Check if aikido-local-scanner is mentioned in the hook
$hookContent = Get-Content $hookScript -Raw
if ($hookContent -notmatch "aikido-local-scanner") {
Write-Host "❌ aikido-local-scanner not found in pre-commit hook" -ForegroundColor Red
exit 1
}

Write-Host "✅ aikido-local-scanner found in pre-commit hook" -ForegroundColor Green
Write-Host ""
Write-Host "✅ Verification complete: Aikido pre-commit hook is installed" -ForegroundColor Green

29 changes: 29 additions & 0 deletions installation-samples/install-global/verify-aikido-hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

# Check if core.hooksPath is set
HOOKS_PATH="$(git config --global core.hooksPath || echo '')"

if [ -z "${HOOKS_PATH}" ]; then
echo "❌ core.hooksPath is not set"
exit 1
fi

echo "✅ core.hooksPath is set to: ${HOOKS_PATH}"

# Check if pre-commit hook exists
HOOK_SCRIPT="${HOOKS_PATH}/pre-commit"
if [ ! -f "${HOOK_SCRIPT}" ]; then
echo "❌ Pre-commit hook file not found at: ${HOOK_SCRIPT}"
exit 1
fi

# Check if aikido-local-scanner is mentioned in the hook
if ! grep -q "aikido-local-scanner" "${HOOK_SCRIPT}"; then
echo "❌ aikido-local-scanner not found in pre-commit hook"
exit 1
fi

echo "✅ aikido-local-scanner found in pre-commit hook"
echo ""
echo "✅ Verification complete: Aikido pre-commit hook is installed"