fix: Read build.properties in --version handler to ensure version is available (#8717)

Ensure build_props_sbt_version is read when handling --version flag,
matching the behavior in the batch file and fixing potential CI test failures.
This commit is contained in:
Eruis2579 2026-02-10 10:35:00 +01:00
parent d11f3623e3
commit 14d92b76eb
1 changed files with 3 additions and 0 deletions

3
sbt
View File

@ -912,6 +912,9 @@ fi
# Handle --version before native client so it works on sbt 2.x project dirs (#8717)
if [[ $print_version ]]; then
detect_working_directory
if [[ -n "$is_this_dir_sbt" ]] && [[ -f ./project/build.properties ]]; then
loadPropFile ./project/build.properties
fi
if [[ -n "$is_this_dir_sbt" ]] && [[ -n "$build_props_sbt_version" ]]; then
echo "sbt version in this project: $build_props_sbt_version"
fi