Poder correr haini.sh recursivamente

This commit is contained in:
f 2021-08-26 16:25:06 -03:00
parent c78456b789
commit e56b1a73d3

View file

@ -15,7 +15,7 @@ if test "$ROOT" != "$(dirname "$PWD")" && test "$ROOT" != "$PWD"; then
fi
# Necesitamos bubblewrap
if ! type bwrap >/dev/null 2>&1 ; then
if ! test "$HAIN_ENV" && ! type bwrap >/dev/null 2>&1 ; then
echo "Por favor, instala el paquete bubblewrap"
exit 1
fi
@ -183,11 +183,15 @@ case $1 in
init) echo "export PATH=$DIR:\$PATH" ; exit ;;
serve) shift; DEFAULT=nginx ;;
*)
if ! type "$SELF" >/dev/null 2>&1 ; then
if ! test "$HAIN_ENV" && ! type "$SELF" >/dev/null 2>&1 ; then
echo "Tip: Inicia haini.sh con 'eval \$($0 init)' para poder ejecutar con solo 'haini.sh'" >&2
fi
;;
esac
crear_entorno
stdin=/dev/stdin correr "${*:-$DEFAULT}"
if test $HAIN_ENV; then
${*:-$DEFAULT}
else
crear_entorno
stdin=/dev/stdin correr "${*:-$DEFAULT}"
fi