diff --git a/clightning-rpc/clightning-rpc.sbt b/clightning-rpc/clightning-rpc.sbt index 22b2fd73ee..d88d49db57 100644 --- a/clightning-rpc/clightning-rpc.sbt +++ b/clightning-rpc/clightning-rpc.sbt @@ -72,10 +72,15 @@ TaskKeys.downloadCLightning := { val success = hash.equalsIgnoreCase(expectedHash) if (hash.equalsIgnoreCase(expectedHash)) { logger.info(s"Download complete and verified, unzipping result") - - val extractCommand = s"tar -xf $archiveLocation --directory $versionDir" - logger.info(s"Extracting archive with command: $extractCommand") - extractCommand.!! + val cmds = Vector( + "tar", + "-xf", + archiveLocation.toString, + "--directory", + versionDir.toString + ) + logger.info(s"Extracting archive with command: $cmds") + cmds.!! } else { logger.error( s"Downloaded invalid version of c-lightning, got $hash, expected $expectedHash") diff --git a/eclair-rpc/eclair-rpc.sbt b/eclair-rpc/eclair-rpc.sbt index 175b4a0fbe..9f411d331d 100644 --- a/eclair-rpc/eclair-rpc.sbt +++ b/eclair-rpc/eclair-rpc.sbt @@ -52,10 +52,14 @@ TaskKeys.downloadEclair := { val success = hash.equalsIgnoreCase(expectedHash) if (success) { logger.info(s"Download complete and verified, unzipping result") - - val extractCommand = s"unzip $archiveLocation -d $versionDir" - logger.info(s"Extracting archive with command: $extractCommand") - extractCommand.!! + val cmds = Vector( + "unzip", + archiveLocation.toString, + "-d", + versionDir.toString + ) + logger.info(s"Extracting archive with command: $cmds") + cmds.!! } else { Files.deleteIfExists(versionDir) logger.error( diff --git a/lnd-rpc/lnd-rpc.sbt b/lnd-rpc/lnd-rpc.sbt index 47ddac75e4..b3f934184c 100644 --- a/lnd-rpc/lnd-rpc.sbt +++ b/lnd-rpc/lnd-rpc.sbt @@ -87,10 +87,15 @@ TaskKeys.downloadLnd := { val success = hash.equalsIgnoreCase(expectedHash) if (success) { logger.info(s"Download complete and verified, unzipping result") - - val extractCommand = s"tar -xzf $archiveLocation --directory $binaryDir" - logger.info(s"Extracting archive with command: $extractCommand") - extractCommand.!! + val cmds = Vector( + "tar", + "-xzf", + archiveLocation.toString, + "--directory", + binaryDir.toString + ) + logger.info(s"Extracting archive with command: $cmds") + cmds.!! } else { Files.deleteIfExists(versionDir) logger.error( diff --git a/testkit/src/main/scala/org/bitcoins/testkit/util/TestkitBinaries.scala b/testkit/src/main/scala/org/bitcoins/testkit/util/TestkitBinaries.scala index 5508e1f0b3..e5a63757f3 100644 --- a/testkit/src/main/scala/org/bitcoins/testkit/util/TestkitBinaries.scala +++ b/testkit/src/main/scala/org/bitcoins/testkit/util/TestkitBinaries.scala @@ -1,12 +1,14 @@ package org.bitcoins.testkit.util -import java.nio.file.{Path, Paths} +import org.bitcoins.commons.config.AppConfig +import java.nio.file.{Path, Paths} import scala.util.Properties object TestkitBinaries { - private val base: Path = Paths.get(".bitcoin-s", "binaries") + private val base: Path = AppConfig.DEFAULT_BITCOIN_S_DATADIR + .resolve("binaries") /** The base directory where binaries needed in tests are located. */ @@ -18,7 +20,7 @@ object TestkitBinaries { /** Gives you an arbitrary root path, and then tacks on .bitcoin-s/binaries/ * onto the end of it */ - def fromRoot(path: Path): Path = { + private def fromRoot(path: Path): Path = { path.resolve(base) } }