-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync-config.sh
More file actions
executable file
·78 lines (61 loc) · 2.22 KB
/
Copy pathsync-config.sh
File metadata and controls
executable file
·78 lines (61 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
# Claude Pentesting Config Sync Script
# Sincroniza la configuración activa de Claude con el repositorio Git
set -e
# Colores para output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Directorios
CLAUDE_DIR="$HOME/.claude"
REPO_DIR="$HOME/Claude-pentesting-config"
echo -e "${GREEN}[INFO] Iniciando sincronización de configuración Claude...${NC}"
# Verificar que existe el directorio de Claude
if [ ! -d "$CLAUDE_DIR" ]; then
echo -e "${RED}[ERROR] No se encuentra el directorio $CLAUDE_DIR${NC}"
exit 1
fi
# Cambiar al directorio del repositorio
cd "$REPO_DIR"
echo -e "${GREEN}[INFO] Sincronizando archivos principales...${NC}"
# Sincronizar archivos principales
cp -v "$CLAUDE_DIR/CLAUDE.md" .
cp -v "$CLAUDE_DIR/htb-playbook.md" .
cp -v "$CLAUDE_DIR/bb-playbook.md" .
cp -v "$CLAUDE_DIR/settings.json" .
cp -v "$CLAUDE_DIR/settings.local.json" .
echo -e "${GREEN}[INFO] Sincronizando directorios...${NC}"
# Sincronizar directorios (eliminar y copiar para evitar archivos obsoletos)
rm -rf hooks commands agents skills 2>/dev/null || true
cp -r "$CLAUDE_DIR/hooks" .
cp -r "$CLAUDE_DIR/commands" .
cp -r "$CLAUDE_DIR/agents" .
cp -r "$CLAUDE_DIR/skills" .
# Verificar estado de git
echo -e "${GREEN}[INFO] Verificando cambios...${NC}"
if git diff --quiet && git diff --cached --quiet; then
echo -e "${YELLOW}[INFO] No hay cambios para confirmar${NC}"
exit 0
fi
# Mostrar estado
git status --short
# Opción de commit automático o manual
if [ "$1" = "--auto" ]; then
echo -e "${GREEN}[INFO] Realizando commit automático...${NC}"
git add -A
git commit -m "Auto-sync: Update Claude pentesting configuration
$(date '+%Y-%m-%d %H:%M:%S')
Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>"
# Push si hay conexión
if git push origin master; then
echo -e "${GREEN}[SUCCESS] Cambios sincronizados y subidos al repositorio${NC}"
else
echo -e "${YELLOW}[WARNING] Commit realizado pero no se pudo hacer push${NC}"
fi
else
echo -e "${YELLOW}[INFO] Cambios detectados. Ejecuta los siguientes comandos para confirmar:${NC}"
echo "git add -A"
echo "git commit -m 'Update Claude pentesting configuration'"
echo "git push origin master"
fi