Skip to content

Commit

Permalink
Merge pull request #765 from mkotsbak/fix_760_docker_fails_on_Windows
Browse files Browse the repository at this point in the history
Make Docker plugin portable so that Windows is supported
  • Loading branch information
muuki88 committed Apr 24, 2016
2 parents cdc207e + 101311e commit 0a212be
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.typesafe.sbt
package packager
package docker

import java.io.File
import sbt._
import sbt.Keys.{
name,
Expand Down Expand Up @@ -61,11 +62,11 @@ object DockerPlugin extends AutoPlugin {
* The separator for makeAdd force UNIX separator.
* The separator doesn't depend to OS where i build Dockerfile.
*/
val UnixSeparatorChar = '/'
val SeparatorChar = File.separatorChar

override def requires = universal.UniversalPlugin

override def projectConfigurations: Seq[Configuration] = Seq(Docker)
override def projectConfigurations: Seq[Configuration] = Seq(Docker)

override lazy val projectSettings = Seq(
dockerBaseImage := "java:latest",
Expand Down Expand Up @@ -157,7 +158,7 @@ object DockerPlugin extends AutoPlugin {
* @return ADD command adding all files inside the installation directory
*/
private final def makeAdd(dockerBaseDirectory: String): CmdLike = {
val files = dockerBaseDirectory.split(UnixSeparatorChar)(1)
val files = dockerBaseDirectory.split(SeparatorChar)(1)
Cmd("ADD", s"$files /$files")
}

Expand Down

0 comments on commit 0a212be

Please sign in to comment.