mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-11-17 13:12:04 +01:00
Fix external version command
This commit is contained in:
parent
951cf9cbca
commit
bd02b11944
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue