Actualización

This commit is contained in:
perro tuerto 2023-06-18 10:32:58 -07:00
parent 2e8f0b1864
commit 2421212292
1 changed files with 9 additions and 4 deletions

View File

@ -296,15 +296,20 @@ aliases () {
fi fi
;; ;;
empujar | push) empujar | push)
repo=$(parent $RLOC_ALIAS)
if [ -f "$RLOC_ALIAS" ]; then if [ -f "$RLOC_ALIAS" ]; then
if [ -f "$OZSH_ALIAS" ] &&[ ! -L "$OZSH_ALIAS" ]; then if [ -f "$OZSH_ALIAS" ] && [ ! -L "$OZSH_ALIAS" ]; then
cp -u $OZSH_ALIAS $RLOC_ALIAS cp -u $OZSH_ALIAS $RLOC_ALIAS
elif [ -f "$BASH_ALIAS" ] && [ ! -L "$BASH_ALIAS" ]; then elif [ -f "$BASH_ALIAS" ] && [ ! -L "$BASH_ALIAS" ]; then
cp -u $BASH_ALIAS $RLOC_ALIAS cp -u $BASH_ALIAS $RLOC_ALIAS
fi fi
git -C $(parent $RLOC_ALIAS) add . if output=$(git -C $repo status --porcelain) && [ ! -z "$output" ]; then
git -C $(parent $RLOC_ALIAS) commit -m "Actualización" git -C $repo add .
git -C $(parent $RLOC_ALIAS) pushall git -C $repo commit -m "Actualización"
fi
git -C $repo pushall
unset output
unset repo
recargar recargar
else else
echo-error "no se pudo empujar al repositorio; no existe el archivo '$RLOC_ALIAS'" echo-error "no se pudo empujar al repositorio; no existe el archivo '$RLOC_ALIAS'"