diff options
author | Robey Pointer <robey@twitter.com> | 2012-05-07 18:00:17 -0700 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2016-11-07 02:08:38 -0500 |
commit | a03c54550d62550ea2292a5947fef4f5bcba040f (patch) | |
tree | fd137dd1e43e5b0a5c44795a19cf0283d5aac248 /libraries/eval | |
parent | 5d00e76b8ffefb3bdddbd50b1efd002357e252f7 (diff) | |
download | cbt-a03c54550d62550ea2292a5947fef4f5bcba040f.tar.gz cbt-a03c54550d62550ea2292a5947fef4f5bcba040f.tar.bz2 cbt-a03c54550d62550ea2292a5947fef4f5bcba040f.zip |
[split] merge stephenjudkins fix for spaces in classpaths.
Diffstat (limited to 'libraries/eval')
-rw-r--r-- | libraries/eval/Eval.scala | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libraries/eval/Eval.scala b/libraries/eval/Eval.scala index 7a45d20..9f75811 100644 --- a/libraries/eval/Eval.scala +++ b/libraries/eval/Eval.scala @@ -309,8 +309,12 @@ class Eval(target: Option[File]) { * This is probably fragile. */ lazy val impliedClassPath: List[String] = { - val currentClassPath = this.getClass.getClassLoader.asInstanceOf[URLClassLoader].getURLs. - map(_.toString).filter(_.startsWith("file:")).map(_.substring(5)).toList + val loader = this.getClass.getClassLoader.asInstanceOf[URLClassLoader] + val currentClassPath = loader.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")) { |