diff --git a/sbtdynver/src/sbt-test/dynver/custom-version-string/build.sbt b/sbtdynver/src/sbt-test/dynver/custom-version-string/build.sbt index f3291cf..0db0e0e 100644 --- a/sbtdynver/src/sbt-test/dynver/custom-version-string/build.sbt +++ b/sbtdynver/src/sbt-test/dynver/custom-version-string/build.sbt @@ -1,4 +1,5 @@ import scala.sys.process.stringToProcess +import scala.sys.process.Process def versionFmt(out: sbtdynver.GitDescribeOutput): String = { val dirtySuffix = out.dirtySuffix.dropPlus.mkString("-", "") @@ -35,26 +36,22 @@ TaskKey[Unit]("checkOnTagAndCommitDirty") := check(version.value, s"1.0.0-1-${he TaskKey[Unit]("gitInitSetup") := { implicit def log2log(log: Logger): scala.sys.process.ProcessLogger = sbtLoggerToScalaSysProcessLogger(log) - "git init".!!(streams.value.log) - "git config user.email dynver@mailinator.com".!!(streams.value.log) - "git config user.name dynver".!!(streams.value.log) + Process("git init", Option(baseDirectory.value)).!!(streams.value.log) + Process("git config user.email dynver@mailinator.com", Option(baseDirectory.value)).!!(streams.value.log) + Process("git config user.name dynver", Option(baseDirectory.value)).!!(streams.value.log) } TaskKey[Unit]("gitAdd") := { implicit def log2log(log: Logger): scala.sys.process.ProcessLogger = sbtLoggerToScalaSysProcessLogger(log) - "git add .".!!(streams.value.log) + Process("git add .", Option(baseDirectory.value)).!!(streams.value.log) } TaskKey[Unit]("gitCommit") := { implicit def log2log(log: Logger): scala.sys.process.ProcessLogger = sbtLoggerToScalaSysProcessLogger(log) - "git commit -am1".!!(streams.value.log) -} -TaskKey[Unit]("gitDiff") := { - implicit def log2log(log: Logger): scala.sys.process.ProcessLogger = sbtLoggerToScalaSysProcessLogger(log) - "git diff".!!(streams.value.log) + Process("git commit -am1", Option(baseDirectory.value)).!!(streams.value.log) } TaskKey[Unit]("gitTag") := { implicit def log2log(log: Logger): scala.sys.process.ProcessLogger = sbtLoggerToScalaSysProcessLogger(log) - "git tag -a v1.0.0 -m1.0.0".!!(streams.value.log) + Process("git tag -a v1.0.0 -m1.0.0", Option(baseDirectory.value)).!!(streams.value.log) } TaskKey[Unit]("dirty") := { diff --git a/sbtdynver/src/sbt-test/dynver/custom-version-string/test b/sbtdynver/src/sbt-test/dynver/custom-version-string/test index d6487d1..9f22a4b 100644 --- a/sbtdynver/src/sbt-test/dynver/custom-version-string/test +++ b/sbtdynver/src/sbt-test/dynver/custom-version-string/test @@ -7,32 +7,26 @@ > dirty > gitAdd > gitCommit -$ sleep 100 > reload > checkOnCommit > dirty -$ sleep 100 > reload > checkOnCommitDirty > gitCommit > gitTag -$ sleep 100 > reload > checkOnTag > dirty -$ sleep 100 > reload > checkOnTagDirty > gitCommit -$ sleep 100 > reload > checkOnTagAndCommit > dirty -$ sleep 100 > reload > checkOnTagAndCommitDirty