Skip to content

Commit

Permalink
Ignore missing sbt file credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Aug 30, 2023
1 parent 7ee8846 commit e9f12d8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugin/src/main/scala/org/scalafmt/sbt/ScalafmtPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,10 @@ object ScalafmtPlugin extends AutoPlugin {
val repositories = resolvers.collect { case r: MavenRepository =>
r.root
}
val repoCredentials = credentials.map { x =>
val cred = Credentials.toDirect(x)
new RepositoryCredential(cred.host, cred.userName, cred.passwd)
val repoCredentials = credentials.flatMap { c =>
Try(Credentials.toDirect(c)).toOption.map { dc =>
new RepositoryCredential(dc.host, dc.userName, dc.passwd)
}
}

log.debug(
Expand Down

0 comments on commit e9f12d8

Please sign in to comment.