You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by rm...@apache.org on 2015/10/19 11:16:17 UTC

tomee git commit: TOMEE-1638 fixing slashes for windows

Repository: tomee
Updated Branches:
  refs/heads/master 56d7ae4f8 -> f68661c08


TOMEE-1638 fixing slashes for windows


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/f68661c0
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/f68661c0
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/f68661c0

Branch: refs/heads/master
Commit: f68661c089249dbb43466cc48630eced99ae75e4
Parents: 56d7ae4
Author: Romain Manni-Bucau <rm...@gmail.com>
Authored: Mon Oct 19 11:16:06 2015 +0200
Committer: Romain Manni-Bucau <rm...@gmail.com>
Committed: Mon Oct 19 11:16:06 2015 +0200

----------------------------------------------------------------------
 .../org/apache/openejb/maven/plugin/runner/ExecRunner.java    | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/f68661c0/maven/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/runner/ExecRunner.java
----------------------------------------------------------------------
diff --git a/maven/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/runner/ExecRunner.java b/maven/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/runner/ExecRunner.java
index d62f052..8cb5eff 100644
--- a/maven/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/runner/ExecRunner.java
+++ b/maven/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/runner/ExecRunner.java
@@ -80,7 +80,7 @@ public class ExecRunner {
         if (extracted != null && extracted.length == 1) {
             distribOutput = extracted[0];
         }
-        final File[] scripts = new File(distribOutput, "conf").listFiles();
+        final File[] scripts = new File(distribOutput, "bin").listFiles();
         if (scripts != null) { // dont use filefilter to avoid dependency issue
             for (final File f : scripts) {
                 if (f.getName().endsWith(".sh") && !f.canExecute()) {
@@ -96,8 +96,9 @@ public class ExecRunner {
             final int lastSlash = cmd.lastIndexOf('/');
             if (lastSlash > 0) {
                 final String dir = cmd.substring(0, lastSlash);
-                final String script = cmd.substring(lastSlash + 1, cmd.length() - SH_BAT_AUTO.length())
-                        + (System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("win") ? ".bat" : ".sh");
+                final boolean isWin = System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("win");
+                final String script = cmd.substring(lastSlash + 1, cmd.length() - SH_BAT_AUTO.length()).replace('/', isWin ? '\\' : '/')
+                        + (isWin ? ".bat" : ".sh");
                 cmd = dir + File.separator + script;
                 final File scriptFile = new File(distribOutput, cmd);
                 if (!scriptFile.exists()) {