Lars, I think you happened to read the code in between two important check-ins.
Please take another look at the latest and let me know if you still have any questions. tc, -john. On Sun, Aug 28, 2011 at 10:37 PM, Lars Corneliussen <[email protected]>wrote: > Hm, how that? The block is nested in path.isAbsolute() - how could it be > executed for relative paths? > Also for a relative path, it should be split up into executablePath and > path, I guess. > > If you handled Linux/Mac, feel free to remove "// TODO: handle linux/mac ?" > :-) > > _ > Lars > > > Am 26.08.11 14:29, schrieb John Fallows: > > It was breaking detection of commands with no extension and relative >> path. >> >> John >> >> >> >> On Aug 25, 2011, at 10:48 PM, Lars >> Corneliussen<me@lcorneliussen.**de<[email protected]>> >> wrote: >> >> Why did you Move the Code above absolute path detection? >>> >>> -- >>> Message sent from mobile device >>> >>> Am 25.08.2011 um 18:49 schrieb [email protected]: >>> >>> Author: jfallows >>>> Date: Thu Aug 25 16:49:36 2011 >>>> New Revision: 1161636 >>>> >>>> URL: >>>> http://svn.apache.org/viewvc?**rev=1161636&view=rev<http://svn.apache.org/viewvc?rev=1161636&view=rev> >>>> Log: >>>> Properly detect executable name without extension >>>> >>>> Modified: >>>> incubator/npanday/trunk/**components/dotnet-core/src/** >>>> main/java/npanday/PathUtil.**java >>>> >>>> Modified: incubator/npanday/trunk/**components/dotnet-core/src/** >>>> main/java/npanday/PathUtil.**java >>>> URL: http://svn.apache.org/viewvc/**incubator/npanday/trunk/** >>>> components/dotnet-core/src/**main/java/npanday/PathUtil.** >>>> java?rev=1161636&r1=1161635&**r2=1161636&view=diff<http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-core/src/main/java/npanday/PathUtil.java?rev=1161636&r1=1161635&r2=1161636&view=diff> >>>> ==============================**==============================** >>>> ================== >>>> --- incubator/npanday/trunk/**components/dotnet-core/src/** >>>> main/java/npanday/PathUtil.**java (original) >>>> +++ incubator/npanday/trunk/**components/dotnet-core/src/** >>>> main/java/npanday/PathUtil.**java Thu Aug 25 16:49:36 2011 >>>> @@ -307,15 +307,16 @@ public final class PathUtil >>>> return null; >>>> >>>> File executableFile = new File(executable); >>>> + if (executableFile.exists()) >>>> + return executableFile; >>>> + >>>> + // handle case where executable is actually absolute >>>> if (executableFile.isAbsolute()) >>>> { >>>> executablePath = executableFile.getParentFile()**; >>>> executable = executableFile.getName(); >>>> } >>>> >>>> - if (executableFile.exists()) >>>> - return executableFile; >>>> - >>>> // TODO: handle linux/mac ? >>>> String[] extensions = new String[] {"exe", "com", "bat", "cmd"}; >>>> >>>> >>>> >>>> > -- >|< Kaazing Corporation >|< John Fallows | CTO | +1.650.960.8148 444 Castro St, Suite 1100 | Mountain View, CA 94041, USA
