Skip to content

Commit

Permalink
Merge pull request #196 from davenverse/useEnv
Browse files Browse the repository at this point in the history
Use cross-platform env
  • Loading branch information
ChristopherDavenport authored Jan 5, 2022
2 parents 57f1578 + 42e3226 commit 66f2b51
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ lazy val core = crossProject(JSPlatform, JVMPlatform)
name := "whale-tail"
)
.jvmSettings(
libraryDependencies += "com.github.jnr" % "jnr-unixsocket" % "0.38.15" % Test,
libraryDependencies ++= Seq(
"com.github.jnr" % "jnr-unixsocket" % "0.38.15" % Test,
)
)
.jsSettings(
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule)},
Expand Down Expand Up @@ -90,10 +92,10 @@ lazy val commonSettings = Seq(
"io.circe" %%% "circe-core" % circeV,
"io.circe" %%% "circe-generic" % circeV,
"io.circe" %%% "circe-parser" % circeV,
"io.chrisdavenport" %%% "env" % "0.1.0",

"org.typelevel" %%% "log4cats-core" % log4catsV,
"org.typelevel" %%% "log4cats-testing" % log4catsV % Test,


"org.typelevel" %%% "cats-effect-testing-specs2" % "1.4.0" % Test,
)
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/io/chrisdavenport/whaletail/Docker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import scodec.bits.ByteVector
import org.http4s.ember.client.EmberClientBuilder
import fs2.io.net.unixsocket.UnixSocketAddress
import org.http4s.client.middleware.UnixSocket

import io.chrisdavenport.env.Env

object Docker {

Expand Down Expand Up @@ -56,7 +56,7 @@ object Docker {
* tcp://0.0.0.0:2375
*/
def default[F[_]: Async]: Resource[F, Client[F]] = for {
baseUriSOpt <- Resource.eval(Sync[F].delay(sys.env.get("DOCKER_HOST")))
baseUriSOpt <- Resource.eval(Env.make[F].get("DOCKER_HOST"))
base <- Resource.eval(baseUriSOpt.traverse(parseConnection[F]))
out <- base match {
case Some(Left(baseUri)) => tcp(baseUri)
Expand Down

0 comments on commit 66f2b51

Please sign in to comment.