From bd02b11944d6cac0be1c98c9ae59b3b211afe6ce Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Thu, 12 Jan 2023 16:04:44 +0100 Subject: [PATCH] Fix external version command --- .../src/main/java/sop/external/operation/VersionExternal.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/external-sop/src/main/java/sop/external/operation/VersionExternal.java b/external-sop/src/main/java/sop/external/operation/VersionExternal.java index b4fc50b..447078a 100644 --- a/external-sop/src/main/java/sop/external/operation/VersionExternal.java +++ b/external-sop/src/main/java/sop/external/operation/VersionExternal.java @@ -31,10 +31,10 @@ public class VersionExternal implements Version { Process process = runtime.exec(command, env); BufferedReader stdInput = new BufferedReader(new InputStreamReader(process.getInputStream())); String line = stdInput.readLine().trim(); + ExternalSOP.finish(process); if (line.contains(" ")) { return line.substring(0, line.lastIndexOf(" ")); } - ExternalSOP.finish(process); return line; } catch (IOException e) { throw new RuntimeException(e); @@ -49,10 +49,10 @@ public class VersionExternal implements Version { Process process = runtime.exec(command, env); BufferedReader stdInput = new BufferedReader(new InputStreamReader(process.getInputStream())); String line = stdInput.readLine().trim(); + ExternalSOP.finish(process); if (line.contains(" ")) { return line.substring(line.lastIndexOf(" ") + 1); } - ExternalSOP.finish(process); return line; } catch (IOException e) { throw new RuntimeException(e);