From f7ec83228512ae44ba6a4d96fbe30cd39102bb0b Mon Sep 17 00:00:00 2001 From: hpratt Date: Sat, 21 Oct 2023 23:07:19 -0400 Subject: [PATCH] fix bsub job regex --- build.gradle.kts | 2 +- src/main/kotlin/krews/executor/bsub/BsubExecutor.kt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 16c9124..7bfbff7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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") } diff --git a/src/main/kotlin/krews/executor/bsub/BsubExecutor.kt b/src/main/kotlin/krews/executor/bsub/BsubExecutor.kt index 62b4f92..fac84fc 100644 --- a/src/main/kotlin/krews/executor/bsub/BsubExecutor.kt +++ b/src/main/kotlin/krews/executor/bsub/BsubExecutor.kt @@ -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" }