43 lines
1.3 KiB
Bash
43 lines
1.3 KiB
Bash
#!/bin/bash
|
|
|
|
echo "🔍 Verificando instalación de git-subir..."
|
|
|
|
# Verificar si el comando está disponible
|
|
if ! command -v git-subir &> /dev/null; then
|
|
echo "❌ El comando 'git-subir' no está disponible en el PATH."
|
|
echo "👉 Asegurate de que ~/.local/bin esté en el PATH y que el script esté instalado."
|
|
exit 1
|
|
fi
|
|
|
|
echo "✅ Comando 'git-subir' disponible."
|
|
|
|
# Verificar si estamos en un repositorio git
|
|
if ! git rev-parse --is-inside-work-tree &> /dev/null; then
|
|
echo "❌ No estás dentro de un repositorio git."
|
|
exit 1
|
|
fi
|
|
|
|
# Verificar upstream
|
|
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
UPSTREAM=$(git rev-parse --symbolic-full-name --verify --quiet "@{u}")
|
|
|
|
if [ -z "$UPSTREAM" ]; then
|
|
echo "⚠️ La rama '$BRANCH' no tiene upstream configurado."
|
|
echo "👉 Se recomienda ejecutar: git push --set-upstream origin $BRANCH"
|
|
else
|
|
echo "✅ Upstream configurado: $UPSTREAM"
|
|
fi
|
|
|
|
# Verificar credenciales
|
|
CONFIG_DIR="$HOME/.config/git-subir"
|
|
if [ -f "$CONFIG_DIR/credenciales.enc" ]; then
|
|
echo "🔐 Credenciales cifradas detectadas."
|
|
elif [ -f "$CONFIG_DIR/credenciales.txt" ]; then
|
|
echo "🔐 Credenciales en texto plano detectadas."
|
|
else
|
|
echo "❌ No se encontraron credenciales en $CONFIG_DIR"
|
|
exit 1
|
|
fi
|
|
|
|
echo "✅ Instalación verificada correctamente."
|