From cc4a6ebf967b8f4dea01ee31183db8c15be2f6ec Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Wed, 22 Jul 2020 23:40:45 +0200 Subject: [PATCH] Allow to execute commands using enter.sh directly (#781) This is useful e.g. if one just wants to run a build. --- scripts/enter.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/enter.sh b/scripts/enter.sh index cc6c619c2..1bfa0de6d 100755 --- a/scripts/enter.sh +++ b/scripts/enter.sh @@ -2,6 +2,8 @@ BUILDER_UID="$(id -u)" BUILDER_GID="$(id -g)" CACHE_DIR="${CACHE_DIR:-$HOME/hassos-cache}" +ARGS="$*" +COMMAND="${ARGS:-bash}" sudo mkdir -p "${CACHE_DIR}" sudo chown -R "${BUILDER_UID}:${BUILDER_GID}" "${CACHE_DIR}" @@ -9,4 +11,4 @@ sudo docker build -t hassos:local . sudo docker run -it --rm --privileged \ -v "$(pwd):/build" -v "${CACHE_DIR}:/cache" \ -e BUILDER_UID="${BUILDER_UID}" -e BUILDER_GID="${BUILDER_GID}" \ - hassos:local bash + hassos:local ${COMMAND}