summaryrefslogtreecommitdiff
path: root/main/src/mill/main/RunScript.scala
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/mill/main/RunScript.scala')
-rw-r--r--main/src/mill/main/RunScript.scala19
1 files changed, 9 insertions, 10 deletions
diff --git a/main/src/mill/main/RunScript.scala b/main/src/mill/main/RunScript.scala
index 1c8503fe..820b1341 100644
--- a/main/src/mill/main/RunScript.scala
+++ b/main/src/mill/main/RunScript.scala
@@ -3,7 +3,6 @@ package mill.main
import java.nio.file.NoSuchFileException
import ammonite.interp.Interpreter
-import ammonite.ops.{Path, read}
import ammonite.runtime.SpecialClassLoader
import ammonite.util.Util.CodeSource
import ammonite.util.{Name, Res, Util}
@@ -23,15 +22,15 @@ import scala.reflect.ClassTag
* subsystem
*/
object RunScript{
- def runScript(home: Path,
- wd: Path,
- path: Path,
- instantiateInterpreter: => Either[(Res.Failing, Seq[(Path, Long)]), ammonite.interp.Interpreter],
+ def runScript(home: os.Path,
+ wd: os.Path,
+ path: os.Path,
+ instantiateInterpreter: => Either[(Res.Failing, Seq[(os.Path, Long)]), ammonite.interp.Interpreter],
scriptArgs: Seq[String],
stateCache: Option[Evaluator.State],
log: Logger,
env : Map[String, String])
- : (Res[(Evaluator, Seq[PathRef], Either[String, Seq[Js.Value]])], Seq[(Path, Long)]) = {
+ : (Res[(Evaluator, Seq[PathRef], Either[String, Seq[Js.Value]])], Seq[(os.Path, Long)]) = {
val (evalState, interpWatched) = stateCache match{
case Some(s) if watchedSigUnchanged(s.watched) => Res.Success(s) -> s.watched
@@ -66,12 +65,12 @@ object RunScript{
(evaluated, interpWatched)
}
- def watchedSigUnchanged(sig: Seq[(Path, Long)]) = {
+ def watchedSigUnchanged(sig: Seq[(os.Path, Long)]) = {
sig.forall{case (p, l) => Interpreter.pathSignature(p) == l}
}
- def evaluateRootModule(wd: Path,
- path: Path,
+ def evaluateRootModule(wd: os.Path,
+ path: os.Path,
interp: ammonite.interp.Interpreter,
log: Logger
): Res[mill.define.BaseModule] = {
@@ -80,7 +79,7 @@ object RunScript{
for {
scriptTxt <-
- try Res.Success(Util.normalizeNewlines(read(path)))
+ try Res.Success(Util.normalizeNewlines(os.read(path)))
catch { case _: NoSuchFileException =>
log.info("No build file found, you should create build.sc to do something useful")
Res.Success("")