From ece7609ff20c64cd58a7b38fdb851b0fd69b02d1 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Fri, 30 May 2014 09:34:41 +0200 Subject: [PATCH 3/3] Fix return code of xmvn-install --- .../java/org/fedoraproject/xmvn/tools/install/cli/InstallerCli.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xmvn-tools/xmvn-install/src/main/java/org/fedoraproject/xmvn/tools/install/cli/InstallerCli.java b/xmvn-tools/xmvn-install/src/main/java/org/fedoraproject/xmvn/tools/install/cli/InstallerCli.java index 36e10e4..e4f0215 100644 --- a/xmvn-tools/xmvn-install/src/main/java/org/fedoraproject/xmvn/tools/install/cli/InstallerCli.java +++ b/xmvn-tools/xmvn-install/src/main/java/org/fedoraproject/xmvn/tools/install/cli/InstallerCli.java @@ -52,7 +52,7 @@ public class InstallerCli this.installer = installer; } - private void run( InstallerCliRequest cliRequest ) + private int run( InstallerCliRequest cliRequest ) { InstallationRequest request = new InstallationRequest(); request.setCheckForUnmatchedRules( !cliRequest.isRelaxed() ); @@ -63,10 +63,12 @@ public class InstallerCli try { installer.install( request ); + return 0; } catch ( ArtifactInstallationException | IOException e ) { logger.error( "Artifact installation failed", e ); + return 1; } } @@ -81,7 +83,7 @@ public class InstallerCli Injector injector = Guice.createInjector( module ); InstallerCli cli = injector.getInstance( InstallerCli.class ); - cli.run( cliRequest ); + System.exit( cli.run( cliRequest ) ); } catch ( Throwable e ) { -- 1.9.0