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