Add util function systemProp

This commit is contained in:
Him188 2021-04-03 23:06:15 +08:00
parent cccdb3cdf2
commit 36742a867f

View File

@ -163,4 +163,7 @@ public inline fun <E> MutableList<E>.replaceAllKotlin(operator: (E) -> E) {
while (li.hasNext()) {
li.set(operator(li.next()))
}
}
}
public fun systemProp(name: String, default: Boolean): Boolean =
System.getProperty(name, default.toString())?.toBoolean() ?: default