mirror of https://github.com/sbt/sbt.git
Merge pull request #7585 from invadergir/allow-spaces-in-build-properties
Trim spaces around k and v to tolerate extra whitespace in build.properties
This commit is contained in:
commit
2f936295f1
11
sbt
11
sbt
|
|
@ -89,6 +89,14 @@ cygwinpath() {
|
|||
fi
|
||||
}
|
||||
|
||||
# Trim leading and trailing spaces from a string.
|
||||
# Echos the new trimmed string.
|
||||
trimString() {
|
||||
local inputStr="$*"
|
||||
local modStr="${inputStr#"${inputStr%%[![:space:]]*}"}"
|
||||
modStr="${modStr%"${modStr##*[![:space:]]}"}"
|
||||
echo "$modStr"
|
||||
}
|
||||
|
||||
declare -r sbt_bin_dir="$(dirname "$(realpathish "$0")")"
|
||||
declare -r sbt_home="$(dirname "$sbt_bin_dir")"
|
||||
|
|
@ -707,6 +715,9 @@ loadConfigFile() {
|
|||
}
|
||||
|
||||
loadPropFile() {
|
||||
# trim key and value so as to be more forgiving with spaces around the '=':
|
||||
k=$(trimString $k)
|
||||
v=$(trimString $v)
|
||||
while IFS='=' read -r k v; do
|
||||
if [[ "$k" == "sbt.version" ]]; then
|
||||
build_props_sbt_version="$v"
|
||||
|
|
|
|||
Loading…
Reference in New Issue