Skip to content

Commit

Permalink
Exit from setupAntEnv is not propagated to its only usecase (#3839)
Browse files Browse the repository at this point in the history
* Exit from setupAntEnv is not propagated to its only usecase

* Revert "Exit from setupAntEnv is not propagated to its only usecase"

This reverts commit 895dd6a.

* exit from $(setupAntEnv) is not propagated.

We ahve to ensure it is fatal, co calling it one more times

* Update sbin/build.sh

* Adjsuted commit message

* Avoid duplicate call to setupAntEnv

* Update sbin/build.sh

Co-authored-by: Martijn Verburg <martijnverburg@gmail.com>

* Update sbin/build.sh

Co-authored-by: Martijn Verburg <martijnverburg@gmail.com>

---------

Co-authored-by: Martijn Verburg <martijnverburg@gmail.com>
  • Loading branch information
judovana and karianna authored Jun 20, 2024
1 parent 182047c commit be1dc31
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sbin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,10 @@ generateSBoM() {
return
fi

local javaHome="$(setupAntEnv)"
# exit from local var=$(setupAntEnv) is not propagated. We have to ensure that the exit propagates, and is fatal for the script
# So the declaration is split. In that case the bug does not occur and thus the `exit 2` from setupAntEnv is correctly propagated
local javaHome
javaHome="$(setupAntEnv)"

buildCyclonedxLib "${javaHome}"
# classpath to run java app TemurinGenSBOM
Expand Down

0 comments on commit be1dc31

Please sign in to comment.