From ec6fb2914ea565b1ebc46915e7ef14206b84ebae Mon Sep 17 00:00:00 2001 From: Steven Murdoch Date: Tue, 17 Jul 2012 15:58:03 +0200 Subject: [PATCH] Correctly identify Windows hosts when os.name property starts with "Windows" os.indexOf("win") <= 0 will return true if "win" is not found *or* the string starts with "win". This will improperly treat platforms which start with "win", e.g. "Windows 7" as if they are *nix. Testing os.indexOf("win") < 0 will return true only if "win" is not found. --- .../src/main/scala/com/typesafe/plugin/sbtGoodiesTasks.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbtgoodies/src/main/scala/com/typesafe/plugin/sbtGoodiesTasks.scala b/sbtgoodies/src/main/scala/com/typesafe/plugin/sbtGoodiesTasks.scala index d0b0965..f49ce89 100644 --- a/sbtgoodies/src/main/scala/com/typesafe/plugin/sbtGoodiesTasks.scala +++ b/sbtgoodies/src/main/scala/com/typesafe/plugin/sbtGoodiesTasks.scala @@ -22,7 +22,7 @@ trait SbtGoodiesTasks extends SbtGoodiesKeys { IO.unzip(zip, distDir) val os = System.getProperty("os.name").toLowerCase() - if (os.indexOf("win") <= 0) { + if (os.indexOf("win") < 0) { //nix val libc = Native.loadLibrary("c", classOf[CLibrary]).asInstanceOf[CLibrary] libc.chmod(unzippedDir.getAbsolutePath+"/start", 0755)