Browse Source

Proper tty support for build.sh

ugv_io
Alex Mikhalev 6 years ago
parent
commit
e1f6cea405
  1. 11
      build.sh

11
build.sh

@ -5,8 +5,15 @@ set -e -x @@ -5,8 +5,15 @@ set -e -x
DIR=$(cd "$(dirname "$0")"; pwd -P)
TOOLCHAIN_IMAGE="esp32-toolchain:latest"
BUILD_DIR="$DIR/cmake-build"
: ${BUILD_DIR:="$DIR/cmake-build"}
DOCKERFILE="$DIR/Dockerfile"
DOCKER_RUN_FLAGS=(--interactive --rm)
# if stdin is a terminal, tell docker to allocate a tty
if [ -t 0 ]; then
DOCKER_RUN_FLAGS+=(--tty)
fi
build_docker_container() {
docker build -f "$DOCKERFILE" -t "$TOOLCHAIN_IMAGE" "$DIR"
@ -16,7 +23,7 @@ build_docker() { @@ -16,7 +23,7 @@ build_docker() {
build_docker_container
docker run \
--volume="$DIR:/esp/uas-ugv" \
--interactive --tty --rm \
"${DOCKER_RUN_FLAGS[@]}" \
"$TOOLCHAIN_IMAGE" \
/esp/uas-ugv/build.sh cmake "$@"
}

Loading…
Cancel
Save