From a6a279f71a30a8aa4cf7c1fa01077f5bb455cc6f Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Thu, 18 Feb 2016 06:46:13 +0400 Subject: [PATCH] Launch the wrapper last. --- src/main/kotlin/com/beust/kobalt/Main.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/beust/kobalt/Main.kt b/src/main/kotlin/com/beust/kobalt/Main.kt index 071e5d83..48009d4c 100644 --- a/src/main/kotlin/com/beust/kobalt/Main.kt +++ b/src/main/kotlin/com/beust/kobalt/Main.kt @@ -153,8 +153,10 @@ private class Main @Inject constructor( // --init: create a new build project and install the wrapper // Make sure the wrapper won't call us back with --noLaunch // - com.beust.kobalt.wrapper.Main.main(arrayOf("--noLaunch") + argv) projectGenerator.run(args, pluginClassLoader) + // The wrapper has to call System.exit() in order to set the exit code, + // so make sure we call it last (or possibly launch it in a separate JVM). + com.beust.kobalt.wrapper.Main.main(arrayOf("--noLaunch") + argv) } else if (args.usage) { jc.usage() } else if (args.serverMode) {