Skip to content

Commit

Permalink
fix default g8 home resolution foundweekends#155
Browse files Browse the repository at this point in the history
  • Loading branch information
konopski committed May 17, 2018
1 parent 8952e47 commit 8ad893f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions library/src/main/scala/giter8/MavenPropertyResolver.scala
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,9 @@ case class MavenPropertyResolver(httpClient: HttpClient) extends PropertyResolve
}

private def mavenRepo: Option[String] = {
val home = Option(System.getProperty("G8_HOME")) match {
case None => new File(System.getProperty("user.home"), ".g8")
case Some(f) => new File(f)
}

val mvnRepo = new File(home + "/mvnrepo")
val homeStr = System.getProperty("G8_HOME", System.getProperty("user.home") + File.separator + ".g8")
val home = new File(homeStr)
val mvnRepo = new File(homeStr + File.separator + "mvnrepo")
if (!home.exists() || !mvnRepo.exists()) None
else {
scala.io.Source.fromFile(mvnRepo).getLines().find(!_.trim.isEmpty)
Expand Down

0 comments on commit 8ad893f

Please sign in to comment.