diff options
author | Stephen Judkins <stephen.judkins@gmail.com> | 2012-05-15 16:29:03 -0700 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2016-11-07 02:08:38 -0500 |
commit | 90a4eb50a31888a669511cb7cac11328cce8ebf7 (patch) | |
tree | bed0589347d1569a89ef4a9289a65665662fedea | |
parent | eec131eb18eb7ca7eb66fa7816349e326952e84a (diff) | |
download | cbt-90a4eb50a31888a669511cb7cac11328cce8ebf7.tar.gz cbt-90a4eb50a31888a669511cb7cac11328cce8ebf7.tar.bz2 cbt-90a4eb50a31888a669511cb7cac11328cce8ebf7.zip |
Eval should now allow classpaths that included spaces
Github-pull-request: https://github.com/twitter/util/pull/24
Signed-off-by: marius a. eriksen <marius@twitter.com>
-rw-r--r-- | libraries/eval/Eval.scala | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/libraries/eval/Eval.scala b/libraries/eval/Eval.scala index 3c3efc8..07f684c 100644 --- a/libraries/eval/Eval.scala +++ b/libraries/eval/Eval.scala @@ -314,12 +314,8 @@ class Eval(target: Option[File]) { * This is probably fragile. */ lazy val impliedClassPath: List[String] = { - val loader = this.getClass.getClassLoader.asInstanceOf[URLClassLoader] - val currentClassPath = loader.getURLs filter { - _.getProtocol == "file" - } map { u => - new File(u.toURI).getPath - } toList + val currentClassPath = this.getClass.getClassLoader.asInstanceOf[URLClassLoader].getURLs. + filter(_.getProtocol == "file").map(u => new File(u.toURI).getPath).toList // if there's just one thing in the classpath, and it's a jar, assume an executable jar. currentClassPath ::: (if (currentClassPath.size == 1 && currentClassPath(0).endsWith(".jar")) { |