Skip to content

Commit

Permalink
Arguments are no longer concatenated together, allowing arguments wit…
Browse files Browse the repository at this point in the history
…h whitespaces:

sbt.bat "sh echo \"foo bar\"" "sh dir \"C:\\Program Files (x86)\""
  • Loading branch information
melezov committed Aug 28, 2013
1 parent 8bda862 commit 7bac2b3
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
8 changes: 4 additions & 4 deletions XsbtShPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ object XsbtShPlugin extends Plugin {
)
)

sealed abstract class OS(val execPrefix: String)
case object Windows extends OS("cmd /c ")
case object Linux extends OS("")
sealed abstract class OS(val execPrefix: String*)
case object Windows extends OS("cmd", "/c")
case object Linux extends OS()

lazy val OS =
sys.props.get("os.name") match {
Expand All @@ -25,7 +25,7 @@ object XsbtShPlugin extends Plugin {

lazy val shCommand =
Command.args("sh", "<shell command>") { (state, args) =>
OS.execPrefix + (args mkString " ")!;
OS.execPrefix ++ args !;
state
}
}
10 changes: 6 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
sbtPlugin := true

organization := "hr.element.xsbt"

name := "xsbt-sh"

version := "0.0.2-SNAPSHOT"
version := "0.0.2"

publishTo := Some(
if (version.value endsWith "SNAPSHOT")
Expand All @@ -13,8 +15,8 @@ publishTo := Some(

credentials += Credentials(Path.userHome / ".config" / "xsbt-sh" / "nexus.config")

organization := "hr.element.xsbt"
scalaVersion := "2.10.2"

// CrossBuilding.crossSbtVersions := Seq("0.11.3", "0.12", "0.13")
// crossBuildingSettings

scalaVersion := "2.10.2"
// CrossBuilding.crossSbtVersions := Seq("0.11.3", "0.12", "0.13")
1 change: 0 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.3.0")
// | Enables building of plugins targeting older versions of SBT |
// +-------------------------------------------------------------------------------------+

// Waiting for 0.13.x!
// addSbtPlugin("net.virtual-void" % "sbt-cross-building" % "0.8.0")

// +-------------------------------------------------------------------------------------+
Expand Down
2 changes: 2 additions & 0 deletions sbt.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
java -jar project\strap\gruj_vs_sbt-launch-0.13.0.jar %*
2 changes: 2 additions & 0 deletions sbt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
java -jar project/strap/gruj_vs_sbt-launch-0.13.0.jar "$*"
1 change: 0 additions & 1 deletion sbt.sh.bat

This file was deleted.

0 comments on commit 7bac2b3

Please sign in to comment.