We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b6247d5 commit 91d7e17Copy full SHA for 91d7e17
1 file changed
src/main/java/com/beaudoin/jmm/misc/Utils.java
@@ -0,0 +1,20 @@
1
+package com.beaudoin.jmm.misc;
2
+
3
+import java.io.IOException;
4
+import java.util.Arrays;
5
+import java.util.Scanner;
6
7
+/**
8
+ * Created by Jonathan on 1/11/16.
9
+ */
10
+public final class Utils {
11
12
+ public static int exec(String... command) {
13
+ try {
14
+ return Integer.parseInt(new Scanner(Runtime.getRuntime().exec(command).getInputStream()).next());
15
+ } catch (IOException e) {
16
+ throw new RuntimeException("Failed to read output from " + Arrays.toString(command));
17
+ }
18
19
20
+}
0 commit comments