mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-03-15 12:20:06 +01:00
Use individual commands for eclair-rpc.sbt, lnd-rpc.sbt, clightning-rpc.sbt, fix TestKitBinaries
This commit is contained in:
parent
c069d996c2
commit
fa49b04dad
4 changed files with 31 additions and 15 deletions
|
@ -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")
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue