Commit 109d9888 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Fix bug on executable

parent aac2adc8
...@@ -26,7 +26,7 @@ trait BiopetCommandLineFunctionTrait extends CommandLineFunction with Configurab ...@@ -26,7 +26,7 @@ trait BiopetCommandLineFunctionTrait extends CommandLineFunction with Configurab
var vmem: String = _ var vmem: String = _
val defaultVmem: String = "" val defaultVmem: String = ""
@Argument(doc = "Executable") @Argument(doc = "Executable", required = false)
var executable: String = _ var executable: String = _
protected[core] def beforeCmd { protected[core] def beforeCmd {
...@@ -66,18 +66,18 @@ trait BiopetCommandLineFunctionTrait extends CommandLineFunction with Configurab ...@@ -66,18 +66,18 @@ trait BiopetCommandLineFunctionTrait extends CommandLineFunction with Configurab
logger.error("executable: '" + executable + "' not found, please check config") logger.error("executable: '" + executable + "' not found, please check config")
throw new QException("executable: '" + executable + "' not found, please check config") throw new QException("executable: '" + executable + "' not found, please check config")
} }
val is = new FileInputStream(executable)
val cnt = is.available
val bytes = Array.ofDim[Byte](cnt)
is.read(bytes)
is.close()
val md5: String = MessageDigest.getInstance("MD5").digest(bytes).map("%02X".format(_)).mkString.toLowerCase
addJobReportBinding("md5sum_exe", md5)
} catch { } catch {
case ioe: java.io.IOException => logger.warn("Could not use 'which', check on executable skipped: " + ioe) case ioe: java.io.IOException => logger.warn("Could not use 'which', check on executable skipped: " + ioe)
} }
val is = new FileInputStream(executable)
val cnt = is.available
val bytes = Array.ofDim[Byte](cnt)
is.read(bytes)
is.close()
val md5: String = MessageDigest.getInstance("MD5").digest(bytes).map("%02X".format(_)).mkString.toLowerCase
addJobReportBinding("md5sum_exe", md5)
} }
final protected def preCmdInternal { final protected def preCmdInternal {
......
Supports Markdown
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