Commit ee97d7f2 authored by Peter van 't Hof's avatar Peter van 't Hof

moved preLoad config to PipelineCommand

parent fe0a89b6
......@@ -92,14 +92,6 @@ object BiopetExecutable extends Logging {
println("version: " + getVersion)
}
case Array(module, name, passArgs @ _*) => {
// Reading config files
val argsSize = passArgs.size
for (t <- 0 until argsSize) {
if (passArgs(t) == "-config" || args(t) == "--config_file") {
if (t >= argsSize) throw new IllegalStateException("-config needs a value")
Config.global.loadConfigFile(new File(passArgs(t + 1)))
}
}
getCommand(module, name).main(passArgs.toArray)
}
case Array(module) => {
......
package nl.lumc.sasc.biopet.core
import org.broadinstitute.gatk.queue.util.{ Logging => GatkLogging }
import java.io.File
import nl.lumc.sasc.biopet.core.config.Config
import nl.lumc.sasc.biopet.core.workaround.BiopetQCommandLine
trait PipelineCommand extends MainCommand with GatkLogging {
......@@ -8,6 +10,14 @@ trait PipelineCommand extends MainCommand with GatkLogging {
def pipeline = "/" + getClass.getName.stripSuffix("$").replaceAll("\\.", "/") + ".class"
def main(args: Array[String]): Unit = {
val argsSize = args.size
for (t <- 0 until argsSize) {
if (args(t) == "-config" || args(t) == "--config_file") {
if (t >= argsSize) throw new IllegalStateException("-config needs a value")
Config.global.loadConfigFile(new File(args(t + 1)))
}
}
var argv: Array[String] = Array()
argv ++= Array("-S", pipeline)
argv ++= args
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment