From d318f0a7b4e4b49b01991439bd7a5632c6e0d1ef Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Thu, 23 Mar 2017 01:36:22 -0700 Subject: [PATCH 1/4] Properly handle symlink --- dist/kobaltw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/kobaltw b/dist/kobaltw index a8df4bb9..2b50c906 100755 --- a/dist/kobaltw +++ b/dist/kobaltw @@ -1,2 +1,2 @@ #!/usr/bin/env sh -java -jar "`dirname "$0"`/../kobalt/wrapper/kobalt-wrapper.jar" $* \ No newline at end of file +java -jar "`dirname "$(readlink -f "$0")"`/../kobalt/wrapper/kobalt-wrapper.jar" $* From cf4013af892fa6731f05f61a19f17333f0ec3bb6 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Thu, 23 Mar 2017 11:08:52 -0700 Subject: [PATCH 2/4] Fix for GYGWIN --- dist/kobaltw | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dist/kobaltw b/dist/kobaltw index 2b50c906..4f39dc35 100755 --- a/dist/kobaltw +++ b/dist/kobaltw @@ -1,2 +1,7 @@ #!/usr/bin/env sh -java -jar "`dirname "$(readlink -f "$0")"`/../kobalt/wrapper/kobalt-wrapper.jar" $* + +DIRNAME=`dirname $(readlink -f "$0")` +if [[ "$(uname)" == "CYGWIN"* ]]; then + DIRNAME=`cygpath -d "$DIRNAME"` +fi +java -jar "${DIRNAME}/../kobalt/wrapper/kobalt-wrapper.jar" $* \ No newline at end of file From 3acf5dc2ad35ccbd6b1b2a8326b00af777250a80 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Fri, 24 Mar 2017 18:27:44 -0700 Subject: [PATCH 3/4] Install launcher(s) if not found. --- .../main/java/com/beust/kobalt/wrapper/Main.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java b/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java index 931f8452..e2e22e42 100644 --- a/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java +++ b/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java @@ -219,6 +219,20 @@ public class Main { log(2, " Couldn't find $VERSION_TEXT, overwriting the installed wrapper"); installWrapperFiles(version, wrapperVersion); } + + // + // Install the launcher if not already found. + // + File kobaltw = new File(KOBALTW); + File kobaltw_bat = new File(KOBALTW_BAT); + + if (!kobaltw.exists()) { + generateKobaltW(kobaltw.toPath()); + } + + if (!kobaltw_bat.exists()) { + generateKobaltWBat(kobaltw_bat.toPath()); + } } return kobaltJarFile; From 03f957f001af132a8fc52b37cd1befb3e1183ee4 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Fri, 24 Mar 2017 20:54:02 -0700 Subject: [PATCH 4/4] Fixed variable name. --- .../src/main/java/com/beust/kobalt/wrapper/Main.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java b/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java index e2e22e42..a9a30385 100644 --- a/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java +++ b/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java @@ -221,17 +221,17 @@ public class Main { } // - // Install the launcher if not already found. + // Install the launcher(s) if not already found. // File kobaltw = new File(KOBALTW); - File kobaltw_bat = new File(KOBALTW_BAT); + File kobaltwBat = new File(KOBALTW_BAT); if (!kobaltw.exists()) { generateKobaltW(kobaltw.toPath()); } - if (!kobaltw_bat.exists()) { - generateKobaltWBat(kobaltw_bat.toPath()); + if (!kobaltwBat.exists()) { + generateKobaltWBat(kobaltwBat.toPath()); } }