@@ -12,7 +12,7 @@ set -o pipefail
1212
1313# See https://github.com/docToolchain/docToolchain/releases for available versions.
1414# Set DTC_VERSION to "latest" to get the latest, yet unreleased version.
15- : " ${DTC_VERSION:= 3.4.0 } "
15+ : " ${DTC_VERSION:= 3.4.1 } "
1616
1717# if not set, public docker hub is used
1818: " ${DTC_DOCKER_PREFIX:= } "
@@ -129,7 +129,9 @@ main() {
129129 fi
130130
131131 # echo "Command to invoke: ${command}"
132- exec ${emu} ${bash} -c " ${command} "
132+ # shellcheck disable=SC2086
133+ # as we hope to know what we are doing here ;-)
134+ exec ${emu} ${bash} ${DTC_SHELL_DEBUG:- } -c " ${command} "
133135}
134136
135137assert_argument_exists () {
@@ -642,12 +644,16 @@ build_command() {
642644 DTC_OPTS=" ${DTC_OPTS} '-Dgradle.user.home=${DTC_ROOT} /.gradle'"
643645 fi
644646 if [ " ${env} " = local ]; then
647+ if [ -x " ${DTC_HOME} /bin/doctoolchain" ]; then
648+ cmd=" ${DTC_HOME} /bin/doctoolchain"
645649 # is doctoolchain available on the path?
646- if command -v doctoolchain > /dev/null 2>&1 ; then
647- cmd=" doctoolchain . ${ * } ${DTC_OPTS} "
650+ elif command -v doctoolchain > /dev/null 2>&1 ; then
651+ cmd=" doctoolchain"
648652 else
649- cmd=" ${DTC_HOME} /bin/doctoolchain . ${* } ${DTC_OPTS} "
653+ echo " Could not find doctoolchain executable, neither in '${DTC_HOME} ' nor on PATH ('${PATH} ')" >&2
654+ exit 1
650655 fi
656+ cmd=" ${cmd} . ${* } ${DTC_OPTS} "
651657 else
652658 cmd=" $( sdk_home_doctoolchain " ${version} " ) /bin/doctoolchain . ${* } ${DTC_OPTS} "
653659 fi
0 commit comments