Skip to content
This repository has been archived by the owner on Mar 19, 2019. It is now read-only.

Commit

Permalink
Strip leading / if present atomist-attic/rug#523
Browse files Browse the repository at this point in the history
  • Loading branch information
kipz committed Apr 24, 2017
1 parent 2992d7c commit c460d7d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/scala/com/atomist/source/artifactContainer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ trait ArtifactContainer {

// TODO what if it's a directory?
def findFile(pathName: String): Option[FileArtifact] = {
val split = pathName.split("/")
val rel = if (pathName.startsWith("/")) pathName.drop(1) else pathName
val split = rel.split("/")
val name = split.last
val pathElements = split.seq.dropRight(1)
findFileByPath(name, pathElements)
Expand Down Expand Up @@ -120,4 +121,4 @@ trait ArtifactContainer {
trait RootArtifactContainer extends ArtifactContainer {

override final protected def relativeToFullPath(pathElements: Seq[String]): Seq[String] = pathElements
}
}

0 comments on commit c460d7d

Please sign in to comment.