Actualización

This commit is contained in:
perro tuerto 2024-04-22 11:46:29 -07:00
parent 5c3b31d03a
commit 9f218aae6a
1 changed files with 18 additions and 15 deletions

View File

@ -417,7 +417,7 @@ nube () {
fi fi
} }
## Instalador de fuentes ### Instalador de fuentes
font-add () { font-add () {
if [ ! -d "$FONT_DIR" ]; then if [ ! -d "$FONT_DIR" ]; then
@ -427,7 +427,7 @@ font-add () {
fc-cache -fv fc-cache -fv
} }
## Conversor de imágenes o documentos con ImageMagick o Pandoc ### Conversor de imágenes o documentos con ImageMagick o Pandoc
convertir () { convertir () {
echo "convertir FORMATO1 a FORMATO2 [con pandoc]" echo "convertir FORMATO1 a FORMATO2 [con pandoc]"
@ -441,7 +441,7 @@ convertir () {
done done
} }
## Gestiona archivos MD ### Gestiona archivos MD
md () { md () {
format () { format () {
@ -491,7 +491,7 @@ Ejemplos:
md ayuda" md ayuda"
} }
# Obtiene directorio padre ### Obtiene directorio padre
parent () { parent () {
if [ $# -eq 0 ]; then curr="$PWD"; else curr=$1; fi if [ $# -eq 0 ]; then curr="$PWD"; else curr=$1; fi
@ -502,7 +502,7 @@ print(Path('$curr').resolve().parent)
unset curr unset curr
} }
## Desactiva o activa virtualenv ### Desactiva o activa virtualenv
check-venv () { check-venv () {
if [ $# -eq 0 ]; then curr="$PWD"; else curr=$1; fi if [ $# -eq 0 ]; then curr="$PWD"; else curr=$1; fi
@ -518,21 +518,21 @@ check-venv () {
check-venv # Ejecuta cuando se carga check-venv # Ejecuta cuando se carga
## Agrega y arranca virtualenv ### Agrega y arranca virtualenv
venv () { venv () {
virtualenv $VENV virtualenv $VENV
check-venv check-venv
} }
## Modifica comportamiento de cd ### Modifica comportamiento de cd
cd () { cd () {
builtin cd $1 builtin cd $1
check-venv check-venv
} }
## Modifica comportamiento de git ### Modifica comportamiento de git
git () { git () {
if [ "$#" -lt 3 ] && [ "$1" = "push" ] && ( [ -z "$2" ] || [ "$2" = "--tags" ] ); then if [ "$#" -lt 3 ] && [ "$1" = "push" ] && ( [ -z "$2" ] || [ "$2" = "--tags" ] ); then
@ -545,7 +545,7 @@ git () {
fi fi
} }
## Embellece y verifica código ### Embellece y verifica código
pymp () { pymp () {
if [ ! -d "${@:$#}" ] && [ ! -f "${@:$#}" ]; then if [ ! -d "${@:$#}" ] && [ ! -f "${@:$#}" ]; then
@ -580,7 +580,7 @@ Ejemplos:
return 0 return 0
} }
# Muesta contenido de archivo embellecido ### Muesta contenido de archivo embellecido
c () { c () {
if [[ $1 == *.json ]]; then if [[ $1 == *.json ]]; then
@ -598,7 +598,8 @@ c () {
fi fi
} }
# Da formato a archivos ### Da formato a archivos
format () { format () {
if [[ $1 == *.md ]]; then if [[ $1 == *.md ]]; then
md format $1 md format $1
@ -611,7 +612,8 @@ format () {
fi fi
} }
# Compara archivos ### Compara archivos
compare () { compare () {
if [[ $(md5sum "$1" | cut -d " " -f1) == $(md5sum "$2" | cut -d " " -f1) ]] if [[ $(md5sum "$1" | cut -d " " -f1) == $(md5sum "$2" | cut -d " " -f1) ]]
then then
@ -621,8 +623,8 @@ compare () {
fi fi
} }
# Emula gitlab-runner sobre docker ### Emula gitlab-runner sobre docker; cfr. https://stackoverflow.com/a/65920577
# Cfr. https://stackoverflow.com/a/65920577
runner () { runner () {
runner=gitlab-runner runner=gitlab-runner
case $1 in case $1 in
@ -665,7 +667,8 @@ Ejemplos:
runner -rm" runner -rm"
} }
# Convierte STDOUT a TSV al reemplazar todos los códigos ANSI por tabuladores ### Convierte STDOUT a TSV al reemplazar todos los códigos ANSI por tabuladores
totsv () { totsv () {
rgx_ansi_codes="\(\x1b\[[0-9;]*[mGKHF]\)\+" rgx_ansi_codes="\(\x1b\[[0-9;]*[mGKHF]\)\+"
rgx_trim="s/^\s*//g;s/\s*$//g" rgx_trim="s/^\s*//g;s/\s*$//g"