Skip to content

Commit

Permalink
fix bsub job regex
Browse files Browse the repository at this point in the history
  • Loading branch information
hpratt committed Oct 22, 2023
1 parent 643b1ff commit f7ec832
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plugins {
}

group = "io.krews"
version = "0.14.13"
version = "0.14.14"

repositories {
maven { setUrl("https://dl.bintray.com/kotlin/kotlin-eap") }
Expand Down
5 changes: 3 additions & 2 deletions src/main/kotlin/krews/executor/bsub/BsubExecutor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,9 @@ class BsubExecutor(private val workflowConfig: WorkflowConfig) : LocallyDirected

val bsubCommand = "echo $bsubScriptAsBase64 | base64 --decode | bsub"
val bsubResponse = commandExecutor.exec(bsubCommand)
val jobId = "\\d+\$".toRegex().find(bsubResponse)?.value
?: throw Exception("JobID not found in response for bsub command")
val jobIdRegex = Regex("""Job <(\d+)>""")
val matchResult = jobIdRegex.find(bsubResponse)
val jobId = matchResult?.groupValues?.get(1) ?: throw Exception("JobID not found in response for bsub command")

log.info { "Job ID $jobId found for bsub command" }

Expand Down

0 comments on commit f7ec832

Please sign in to comment.