Don't print info messages when entry is via cordformation ()

This commit is contained in:
Anthony Keenan 2018-12-05 10:09:08 +00:00 committed by GitHub
parent bac693a6f3
commit bdd893fb57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -483,9 +483,11 @@ interface NetworkBootstrapperWithOverridableParameters {
enum class CopyCordapps {
FirstRunOnly {
override fun copy(cordappJars: List<Path>, nodeDirs: List<Path>, networkAlreadyExists: Boolean) {
override fun copyTo(cordappJars: List<Path>, nodeDirs: List<Path>, networkAlreadyExists: Boolean, fromCordform: Boolean) {
if (networkAlreadyExists) {
println("Not copying CorDapp JARs as --copy-cordapps is set to FirstRunOnly, and it looks like this network has already been bootstrapped.")
if (!fromCordform) {
println("Not copying CorDapp JARs as --copy-cordapps is set to FirstRunOnly, and it looks like this network has already been bootstrapped.")
}
return
}
cordappJars.copy(nodeDirs)
@ -493,14 +495,18 @@ enum class CopyCordapps {
},
Yes {
override fun copy(cordappJars: List<Path>, nodeDirs: List<Path>, networkAlreadyExists: Boolean) = cordappJars.copy(nodeDirs)
override fun copyTo(cordappJars: List<Path>, nodeDirs: List<Path>, networkAlreadyExists: Boolean, fromCordform: Boolean) = cordappJars.copy(nodeDirs)
},
No {
override fun copy(cordappJars: List<Path>, nodeDirs: List<Path>, networkAlreadyExists: Boolean) = println("Not copying CorDapp JARs as --copy-cordapps is set to No.")
override fun copyTo(cordappJars: List<Path>, nodeDirs: List<Path>, networkAlreadyExists: Boolean, fromCordform: Boolean) {
if (!fromCordform) {
println("Not copying CorDapp JARs as --copy-cordapps is set to No.")
}
}
};
protected abstract fun copy(cordappJars: List<Path>, nodeDirs: List<Path>, networkAlreadyExists: Boolean)
protected abstract fun copyTo(cordappJars: List<Path>, nodeDirs: List<Path>, networkAlreadyExists: Boolean, fromCordform: Boolean)
protected fun List<Path>.copy(nodeDirs: List<Path>) {
if (this.isNotEmpty()) {
@ -522,6 +528,6 @@ enum class CopyCordapps {
if (!fromCordform) {
println("Found the following CorDapps: ${cordappJars.map { it.fileName }}")
}
this.copy(cordappJars, nodeDirs, networkAlreadyExists)
this.copyTo(cordappJars, nodeDirs, networkAlreadyExists, fromCordform)
}
}