Use individual commands for eclair-rpc.sbt, lnd-rpc.sbt, clightning-rpc.sbt, fix TestKitBinaries

This commit is contained in:
Chris Stewart 2024-07-17 10:49:22 -05:00
parent c069d996c2
commit fa49b04dad
4 changed files with 31 additions and 15 deletions

View file

@ -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")

View file

@ -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(

View file

@ -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(

View file

@ -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)
}
}