kumquat-buildroot/utils/docker-run
Arnout Vandecappelle 2c3466bbee utils/docker-run: fix shellcheck errors
In utils/docker-run line 10:
    --user $(id -u):$(id -g) \
           ^------^ SC2046: Quote this to prevent word splitting.
                    ^------^ SC2046: Quote this to prevent word splitting.

The suggestions from shellcheck can be applied.

Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
2023-02-08 15:28:31 +01:00

14 lines
439 B
Bash
Executable File

#!/usr/bin/env bash
set -o errexit -o pipefail
DIR=$(dirname "${0}")
MAIN_DIR=$(readlink -f "${DIR}/..")
# shellcheck disable=SC2016
IMAGE=$(grep ^image: "${MAIN_DIR}/.gitlab-ci.yml" | \
sed -e 's,^image: ,,g' | sed -e 's,\$CI_REGISTRY,registry.gitlab.com,g')
exec docker run -it --rm \
--user "$(id -u):$(id -g)" \
--mount "type=bind,src=${MAIN_DIR},dst=${MAIN_DIR}" \
--workdir "${MAIN_DIR}" \
"${IMAGE}" "${@}"