Skip to content

Commit e9f12d8

Browse files
committed
Ignore missing sbt file credentials
1 parent 7ee8846 commit e9f12d8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plugin/src/main/scala/org/scalafmt/sbt/ScalafmtPlugin.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,10 @@ object ScalafmtPlugin extends AutoPlugin {
158158
val repositories = resolvers.collect { case r: MavenRepository =>
159159
r.root
160160
}
161-
val repoCredentials = credentials.map { x =>
162-
val cred = Credentials.toDirect(x)
163-
new RepositoryCredential(cred.host, cred.userName, cred.passwd)
161+
val repoCredentials = credentials.flatMap { c =>
162+
Try(Credentials.toDirect(c)).toOption.map { dc =>
163+
new RepositoryCredential(dc.host, dc.userName, dc.passwd)
164+
}
164165
}
165166

166167
log.debug(

0 commit comments

Comments
 (0)