[IMPROVED] Agregar función de alias cortana y actualizar .gitignore

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Mauro Rosero P. 2025-03-11 04:44:49 -05:00
parent 6022aa12b7
commit a760bbb075
Signed by: mrosero
GPG key ID: 83BD2A5F674B7E26
3 changed files with 38 additions and 0 deletions

3
.gitignore vendored
View file

@ -21,6 +21,9 @@
!README.md !README.md
!.gitignore !.gitignore
# Ignorar archivos específicos
CLAUDE.md
# Permitir archivos en carpetas específicas # Permitir archivos en carpetas específicas
# !carpeta1/*.txt # !carpeta1/*.txt
!bin/* !bin/*

View file

@ -78,6 +78,7 @@ install_anthropic() {
pre_anthropic pre_anthropic
npm install -g @anthropic-ai/claude-code npm install -g @anthropic-ai/claude-code
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
cortana_alias
dialog --backtitle "${title}" --title "${npm_014}" --msgbox "${npm_024}" 7 50 dialog --backtitle "${title}" --title "${npm_014}" --msgbox "${npm_024}" 7 50
else else
dialog --backtitle "${title}" --title "${head-error}" --msgbox "${npm_025}" 7 50 dialog --backtitle "${title}" --title "${head-error}" --msgbox "${npm_025}" 7 50

View file

@ -416,3 +416,37 @@ function sops_freekv_token() {
return 0 return 0
} }
# Alias claude code to cortana
cortana_alias() {
local alias_nombre="cortana"
local alias_comando="claude"
local shell_config=""
# Detectar el shell actual y seleccionar el archivo de configuración adecuado
case "$SHELL" in
*/bash)
shell_config="$HOME/.bashrc"
;;
*/zsh)
shell_config="$HOME/.zshrc"
;;
*)
return 1
;;
esac
# Verificar si el alias ya existe en el archivo de configuración
if grep -q "alias $alias_nombre=" "$shell_config"; then
return 2
else
# Agregar el alias al final del archivo de configuración
echo "alias $alias_nombre='$alias_comando'" >> "$shell_config"
if [[ $? -eq 0 ]]; then
# Recargar el archivo de configuración
source "$shell_config"
else
return 1
fi
fi
}