devs/bin/cortana_alias.sh
Mauro Rosero P. c9529a1f93
[FIXED] Externalizar mensajes de los scripts de Cortana a variables en head.es
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-11 08:31:44 -05:00

32 lines
922 B
Bash
Executable file

#!/bin/bash
# Source de head.es para cargar los mensajes
DEVSPATH=devs
BIN_HOME=$HOME/$DEVSPATH
BIN_MESG=bin/msg
BIN_LIBS=bin/lib
BIN_LANG=${LANG:0:2}
# Intentar cargar mensajes (si es posible)
if [ -f "$BIN_HOME/$BIN_LIBS/base.lib" ] && [ -f "$BIN_HOME/$BIN_MESG/head.$BIN_LANG" ]; then
source "$BIN_HOME/$BIN_LIBS/base.lib"
load_messages $BIN_HOME $BIN_MESG $BIN_LANG "head"
USE_MESSAGES=true
else
USE_MESSAGES=false
fi
# Verificar si ~/.npm-global/bin está en el PATH
if [[ ":$PATH:" != *":$HOME/.npm-global/bin:"* ]]; then
# Si no está en el PATH, usamos la ruta completa en el alias
alias cortana="$HOME/.npm-global/bin/claude"
else
# Si está en el PATH, podemos usar el nombre directamente
alias cortana="claude"
fi
# Mostrar el mensaje usando variables si están disponibles
if [ "$USE_MESSAGES" = true ]; then
echo "${npm_046}"
else
echo "Alias cortana activado en la sesión actual."
fi