From 9dfcef234722d5d5151b8c30c0b92ee3fe642dfb Mon Sep 17 00:00:00 2001 From: Olivier Melois Date: Thu, 5 Apr 2018 11:46:21 +0100 Subject: Adds test for client -> server map propagation * Moved the `System.getenv` side effect to the end of the world * Adds a test to make sure that the `Map[String, String]` gets propagated correctly * Adds a `Ctx.Env` trait for consistency https://github.com/lihaoyi/mill/issues/257 --- core/src/mill/util/Ctx.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'core/src') diff --git a/core/src/mill/util/Ctx.scala b/core/src/mill/util/Ctx.scala index 88a8baec..6c8b2afb 100644 --- a/core/src/mill/util/Ctx.scala +++ b/core/src/mill/util/Ctx.scala @@ -23,6 +23,9 @@ object Ctx{ trait Home{ def home: Path } + trait Env{ + def env: Map[String, String] + } object Log{ implicit def logToCtx(l: Logger): Log = new Log { def log = l } } @@ -41,7 +44,8 @@ class Ctx(val args: IndexedSeq[_], extends Ctx.Dest with Ctx.Log with Ctx.Args - with Ctx.Home{ + with Ctx.Home + with Ctx.Env { def dest = dest0() def length = args.length -- cgit v1.2.3