From e56b1a73d35c5e1d0c87feab4cf2c50b627bdd61 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 26 Aug 2021 16:25:06 -0300 Subject: [PATCH] Poder correr haini.sh recursivamente --- haini.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/haini.sh b/haini.sh index 2d96cb8..b26821c 100755 --- a/haini.sh +++ b/haini.sh @@ -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