diff options
author | Nikolay Tatarinov <5min4eq.unity@gmail.com> | 2018-01-02 02:12:29 +0300 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-01-01 15:12:29 -0800 |
commit | e1241f1da8e55cfba3286c438ac26e4d09df63ff (patch) | |
tree | 6ecadda543759300ef8124baade0732a9a249db2 /core/src/main/scala | |
parent | f5a5de94c499d14bbcde848fa218afebde8b3617 (diff) | |
download | mill-e1241f1da8e55cfba3286c438ac26e4d09df63ff.tar.gz mill-e1241f1da8e55cfba3286c438ac26e4d09df63ff.tar.bz2 mill-e1241f1da8e55cfba3286c438ac26e4d09df63ff.zip |
don't fail with match error on empty selector (#98)
Diffstat (limited to 'core/src/main/scala')
-rw-r--r-- | core/src/main/scala/mill/main/RunScript.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/src/main/scala/mill/main/RunScript.scala b/core/src/main/scala/mill/main/RunScript.scala index ced0bbc1..53347fd6 100644 --- a/core/src/main/scala/mill/main/RunScript.scala +++ b/core/src/main/scala/mill/main/RunScript.scala @@ -94,7 +94,9 @@ object RunScript{ def evaluateTarget[T](evaluator: Evaluator[_], scriptArgs: Seq[String]) = { - val Seq(selectorString, rest @_*) = scriptArgs + val selectorString = scriptArgs.headOption.getOrElse("") + val rest = scriptArgs.drop(1) + for { sel <- parseArgs(selectorString) crossSelectors = sel.map{ @@ -184,4 +186,4 @@ object RunScript{ Right(()) } } -}
\ No newline at end of file +} |