mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-12-22 21:07:57 +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);
|
Process process = runtime.exec(command, env);
|
||||||
BufferedReader stdInput = new BufferedReader(new InputStreamReader(process.getInputStream()));
|
BufferedReader stdInput = new BufferedReader(new InputStreamReader(process.getInputStream()));
|
||||||
String line = stdInput.readLine().trim();
|
String line = stdInput.readLine().trim();
|
||||||
|
ExternalSOP.finish(process);
|
||||||
if (line.contains(" ")) {
|
if (line.contains(" ")) {
|
||||||
return line.substring(0, line.lastIndexOf(" "));
|
return line.substring(0, line.lastIndexOf(" "));
|
||||||
}
|
}
|
||||||
ExternalSOP.finish(process);
|
|
||||||
return line;
|
return line;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
@ -49,10 +49,10 @@ public class VersionExternal implements Version {
|
||||||
Process process = runtime.exec(command, env);
|
Process process = runtime.exec(command, env);
|
||||||
BufferedReader stdInput = new BufferedReader(new InputStreamReader(process.getInputStream()));
|
BufferedReader stdInput = new BufferedReader(new InputStreamReader(process.getInputStream()));
|
||||||
String line = stdInput.readLine().trim();
|
String line = stdInput.readLine().trim();
|
||||||
|
ExternalSOP.finish(process);
|
||||||
if (line.contains(" ")) {
|
if (line.contains(" ")) {
|
||||||
return line.substring(line.lastIndexOf(" ") + 1);
|
return line.substring(line.lastIndexOf(" ") + 1);
|
||||||
}
|
}
|
||||||
ExternalSOP.finish(process);
|
|
||||||
return line;
|
return line;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|
Loading…
Reference in a new issue