mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-02-23 14:50:42 +01:00
fixed windows issues
This commit is contained in:
parent
3926030e24
commit
136b59917c
1 changed files with 14 additions and 16 deletions
|
@ -39,13 +39,11 @@ sealed trait BitcoindInstance extends BitcoinSLogger {
|
||||||
def getVersion: BitcoindVersion = {
|
def getVersion: BitcoindVersion = {
|
||||||
|
|
||||||
val binaryPath = binary.getAbsolutePath
|
val binaryPath = binary.getAbsolutePath
|
||||||
val foundVersion = if(Properties.isWin)
|
|
||||||
{Seq(binaryPath, "--version").!!.split("\r\n").head.split(" ").last}
|
val foundVersion =
|
||||||
else{
|
Seq(binaryPath, "--version").!!.split(Properties.lineSeparator).head
|
||||||
Seq(binaryPath, "--version").!!.split("\n").head
|
|
||||||
.split(" ")
|
.split(" ")
|
||||||
.last
|
.last
|
||||||
}
|
|
||||||
|
|
||||||
foundVersion match {
|
foundVersion match {
|
||||||
case _: String if foundVersion.startsWith(BitcoindVersion.V16.toString) =>
|
case _: String if foundVersion.startsWith(BitcoindVersion.V16.toString) =>
|
||||||
|
@ -90,15 +88,15 @@ object BitcoindInstance {
|
||||||
|
|
||||||
lazy val DEFAULT_BITCOIND_LOCATION: File = {
|
lazy val DEFAULT_BITCOIND_LOCATION: File = {
|
||||||
|
|
||||||
|
val cmd = Try(
|
||||||
val path = if (Properties.isWin) {
|
if (Properties.isWin) {
|
||||||
"which bitcoind.exe".!!
|
"bitcoind.exe".!!
|
||||||
|
} else {
|
||||||
|
"bitcoind".!!
|
||||||
}
|
}
|
||||||
else {
|
).getOrElse(
|
||||||
Try("which bitcoind".!!)
|
|
||||||
.getOrElse(
|
|
||||||
throw new RuntimeException("Could not locate bitcoind on user PATH"))
|
throw new RuntimeException("Could not locate bitcoind on user PATH"))
|
||||||
}
|
val path = cmd
|
||||||
new File(path.trim)
|
new File(path.trim)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue