Skip to content

Commit 1c9aa8c

Browse files
CopilotBYK
andcommitted
Move dcx after if/else block and use exec_proxy_args for DRY
Co-authored-by: BYK <[email protected]>
1 parent 5375e5b commit 1c9aa8c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

install/dc-detect-version.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ else
4848
fi
4949

5050
proxy_args="--build-arg HTTP_PROXY=${HTTP_PROXY:-} --build-arg HTTPS_PROXY=${HTTPS_PROXY:-} --build-arg NO_PROXY=${NO_PROXY:-} --build-arg http_proxy=${http_proxy:-} --build-arg https_proxy=${https_proxy:-} --build-arg no_proxy=${no_proxy:-}"
51-
# Shortcut for docker compose exec with http proxy environment variables
52-
dcx="$dc exec -e \"HTTP_PROXY=${HTTP_PROXY:-}\" -e \"HTTPS_PROXY=${HTTPS_PROXY:-}\" -e \"NO_PROXY=${NO_PROXY:-}\" -e \"http_proxy=${http_proxy:-}\" -e \"https_proxy=${https_proxy:-}\" -e \"no_proxy=${no_proxy:-}\""
51+
exec_proxy_args="-e HTTP_PROXY=${HTTP_PROXY:-} -e HTTPS_PROXY=${HTTPS_PROXY:-} -e NO_PROXY=${NO_PROXY:-} -e http_proxy=${http_proxy:-} -e https_proxy=${https_proxy:-} -e no_proxy=${no_proxy:-}"
5352
if [[ "$CONTAINER_ENGINE" == "podman" ]]; then
5453
proxy_args_dc="--podman-build-args HTTP_PROXY=${HTTP_PROXY:-},HTTPS_PROXY=${HTTPS_PROXY:-},NO_PROXY=${NO_PROXY:-},http_proxy=${http_proxy:-},https_proxy=${https_proxy:-},no_proxy=${no_proxy:-}"
5554
# Disable pod creation as these are one-off commands and creating a pod
@@ -62,6 +61,7 @@ else
6261
fi
6362
dcb="$dc build $proxy_args"
6463
dbuild="$CONTAINER_ENGINE build $proxy_args"
64+
dcx="$dc exec $exec_proxy_args"
6565
echo "$dcr"
6666
# Utility function to handle --wait with docker and podman
6767
function start_service_and_wait_ready() {

0 commit comments

Comments
 (0)