diff --git a/eng/build.sh b/eng/build.sh index bcbcdb37bd2..8906e4c1287 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/usr/bin/env bash configuration="Debug" test=false @@ -92,10 +92,10 @@ fi # Log the stage 1 build command so that it's clear which arguments flow to it. if [ "$stage2" = true ]; then - echo "Stage 1 build: /bin/bash \"$build_script\" ${build_args[*]}" + printf 'Stage 1 build: %q %q %s\n' "$BASH" "$build_script" "$(printf '%q ' "${build_args[@]}")" fi -/bin/bash "$build_script" "${build_args[@]}" +"$BASH" "$build_script" "${build_args[@]}" stage1_exit_code=$? if [ "$stage2" != true ]; then @@ -174,7 +174,7 @@ fi # until a stable version of MT is available in the images. stage2_build_args+=( ${stage2Arguments[@]+"${stage2Arguments[@]}"} ) -echo "Stage 2 build: /bin/bash \"$build_script\" ${stage2_build_args[*]}" +printf 'Stage 2 build: %q %q %s\n' "$BASH" "$build_script" "$(printf '%q ' "${stage2_build_args[@]}")" # Needs to run out-of-proc to not inherit the stage 1 build's state variables. -/bin/bash "$build_script" "${stage2_build_args[@]}" +"$BASH" "$build_script" "${stage2_build_args[@]}" exit $?