Skip to content

Commit

Permalink
Merge pull request #406 from perfectsense/bugfix/return-exit-status-w…
Browse files Browse the repository at this point in the history
…hen-run-fails

Fix: Return proper exit status on gyro run fail
  • Loading branch information
deepanjan90 authored Sep 6, 2022
2 parents 88506bb + 2667d55 commit 66913a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cli/src/main/java/gyro/cli/Gyro.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public static void main(String[] arguments) {
});

gyro.init(Arrays.asList(arguments));
gyro.run();
exitStatus = gyro.run();

} catch (Abort error) {
exitStatus = 3;
Expand Down Expand Up @@ -245,7 +245,7 @@ private static int invalidUserInput(Exception error, CommandLine commandLine, Co
return 2;
}

public void run() {
public int run() {

try {
CommandLine.ParseResult parseResult = commandLine.parseArgs(arguments.toArray(new String[0]));
Expand All @@ -264,7 +264,7 @@ public void run() {
// The execute will handle throwing the error
}

commandLine.execute(this.arguments.toArray(new String[0]));
return commandLine.execute(this.arguments.toArray(new String[0]));
}

public static Reflections getReflections() {
Expand Down

0 comments on commit 66913a3

Please sign in to comment.