mirror of https://github.com/sbt/sbt.git
Don't double wrap setting value
Oh the wonderful world of Object#toString
This commit is contained in:
parent
317085a458
commit
9f13499bcf
|
|
@ -84,7 +84,7 @@ final class NetworkChannel(val name: String, connection: Socket, structure: Buil
|
||||||
|
|
||||||
val key = Parser.parse(req.setting, SettingQuery.scopedKeyParser(structure, currentBuild))
|
val key = Parser.parse(req.setting, SettingQuery.scopedKeyParser(structure, currentBuild))
|
||||||
|
|
||||||
def getSettingValue[A](key: Def.ScopedKey[A]) =
|
def getSettingValue[A](key: Def.ScopedKey[A]): Either[String, A] =
|
||||||
structure.data.get(key.scope, key.key)
|
structure.data.get(key.scope, key.key)
|
||||||
.toRight(s"Key ${Def displayFull key} not found")
|
.toRight(s"Key ${Def displayFull key} not found")
|
||||||
.flatMap {
|
.flatMap {
|
||||||
|
|
@ -93,12 +93,12 @@ final class NetworkChannel(val name: String, connection: Socket, structure: Buil
|
||||||
case x => Right(x)
|
case x => Right(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
val values = key match {
|
val values: Either[String, Any] = key match {
|
||||||
case Left(msg) => Left(s"Invalid programmatic input: $msg")
|
case Left(msg) => Left(s"Invalid programmatic input: $msg")
|
||||||
case Right(key) => Right(getSettingValue(key))
|
case Right(key) => getSettingValue(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
val jsonValues = values match {
|
val jsonValues: String = values match {
|
||||||
case Left(errors) => errors
|
case Left(errors) => errors
|
||||||
case Right(value) => value.toString
|
case Right(value) => value.toString
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue