mirror of https://github.com/sbt/sbt.git
Read last line of config files without EOL
The last line in a configuration file may not have a terminating EOL character. This commit fixes the launcher script to read that line as well. Inspiration: https://stackoverflow.com/questions/10929453/read-a-file-line-by-line-assigning-the-value-to-a-variable
This commit is contained in:
parent
ace1846e36
commit
a616031ca3
|
|
@ -135,7 +135,8 @@ process_my_args () {
|
||||||
}
|
}
|
||||||
|
|
||||||
loadConfigFile() {
|
loadConfigFile() {
|
||||||
cat "$1" | sed '/^\#/d' | while read line; do
|
# Make sure the last line is read even if it doesn't have a terminating \n
|
||||||
|
cat "$1" | sed '/^\#/d' | while read -r line || [[ -n "$line" ]]; do
|
||||||
eval echo $line
|
eval echo $line
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue