mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2025-09-08 17:59:43 +02:00
Implement sop version --sop-spec
This commit is contained in:
parent
dfce1ad6bb
commit
f49c16e4c5
4 changed files with 45 additions and 0 deletions
|
@ -99,4 +99,23 @@ public class VersionExternal implements Version {
|
|||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSopSpecVersion() {
|
||||
String[] command = new String[] {binary, "version", "--sop-spec"};
|
||||
String[] env = ExternalSOP.propertiesToEnv(environment).toArray(new String[0]);
|
||||
try {
|
||||
Process process = runtime.exec(command, env);
|
||||
BufferedReader stdInput = new BufferedReader(new InputStreamReader(process.getInputStream()));
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String line;
|
||||
while ((line = stdInput.readLine()) != null) {
|
||||
sb.append(line).append('\n');
|
||||
}
|
||||
ExternalSOP.finish(process);
|
||||
return sb.toString();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue