From 4fea8110d91a459529c412163c6aa2877c0d5332 Mon Sep 17 00:00:00 2001 From: f Date: Sat, 8 May 2021 20:22:42 -0300 Subject: [PATCH 1/2] agrega la variable HAIN_ENV=true MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit para que los programas sepan cuándo están dentro de hain --- haini.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/haini.sh b/haini.sh index 8c3b92f..2c28158 100755 --- a/haini.sh +++ b/haini.sh @@ -25,6 +25,7 @@ function correr() { USER="$USER" \ HOME="/home/suttier" \ RAILS_ENV=development \ + HAIN_ENV=true \ bwrap \ --unshare-user-try \ --unshare-ipc \ From cd2d801b27a67abf781f353d636b590c69d36c03 Mon Sep 17 00:00:00 2001 From: void Date: Sun, 16 May 2021 15:45:16 +0000 Subject: [PATCH 2/2] POSIXificar (verificado con shellcheck) --- haini.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/haini.sh b/haini.sh index 2c28158..c83860e 100755 --- a/haini.sh +++ b/haini.sh @@ -10,15 +10,15 @@ test -d ../sutty/.git || git clone git@0xacab.org:sutty/sutty.git ../sutty ENTORNO=../hain -function correr() { +correr() { echo "> $1" # Necesitamos bubblewrap type bwrap >/dev/null || exit 1 - mkdir -p $ENTORNO/home + mkdir -p "$ENTORNO/home" # migrar de versiones anteriores de hainish - test -d $ENTORNO$HOME && mv $ENTORNO$HOME $ENTORNO/home/suttier + test -d "$ENTORNO$HOME" && mv "$ENTORNO$HOME" "$ENTORNO/home/suttier" env -i \ TERM="$TERM" \ @@ -46,14 +46,13 @@ function correr() { /bin/sh -l -c "$1" } -function crear_entorno() { +crear_entorno() { if test -d "$ENTORNO"; then echo "El entorno ya existe en $ENTORNO" return fi - # La versión de Alpine es el segundo argumento - ALPINE="${2:-3.13.5}" + ALPINE="3.13.5" ALPINE_URL="https://dl-cdn.alpinelinux.org/alpine/v${ALPINE%.*}/releases/x86_64/alpine-minirootfs-${ALPINE}-x86_64.tar.gz" # Definir si vamos a usar wget o curl @@ -74,7 +73,7 @@ function crear_entorno() { ${download} "${ALPINE_URL}" | tar xz --directory "$ENTORNO" # Directorio de instalación de las gemas - install -dm 755 -o ${USER} -g $(id -g ${USER}) "$ENTORNO/opt/sutty" + install -dm 755 -o "${USER}" -g "$(id -g "${USER}")" "$ENTORNO/opt/sutty" # Instalar las dependencias echo "Instalando paquetes..."