Skip to content

Commit ec362d8

Browse files
committed
Handle optional value using null as default param
better than using empty string as default param.
1 parent 63e49f9 commit ec362d8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scalalib/src/mill/scalalib/PublishModule.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ trait PublishModule extends JavaModule { outer =>
7373
}
7474

7575
def publish(sonatypeCreds: String,
76-
gpgPassphrase: String = "",
76+
gpgPassphrase: String = null,
7777
signed: Boolean = true,
7878
release: Boolean): define.Command[Unit] = T.command {
7979
val PublishModule.PublishData(artifactInfo, artifacts) = publishArtifacts()
8080
new SonatypePublisher(
8181
sonatypeUri,
8282
sonatypeSnapshotUri,
8383
sonatypeCreds,
84-
Some(gpgPassphrase).filter(_.nonEmpty),
84+
Option(gpgPassphrase),
8585
signed,
8686
T.ctx().log
8787
).publish(artifacts.map{case (a, b) => (a.path, b)}, artifactInfo, release)
@@ -96,7 +96,7 @@ object PublishModule extends ExternalModule {
9696
}
9797

9898
def publishAll(sonatypeCreds: String,
99-
gpgPassphrase: String = "",
99+
gpgPassphrase: String = null,
100100
signed: Boolean = true,
101101
publishArtifacts: mill.main.Tasks[PublishModule.PublishData],
102102
release: Boolean = false,
@@ -110,7 +110,7 @@ object PublishModule extends ExternalModule {
110110
sonatypeUri,
111111
sonatypeSnapshotUri,
112112
sonatypeCreds,
113-
Some(gpgPassphrase).filter(_.nonEmpty),
113+
Option(gpgPassphrase),
114114
signed,
115115
T.ctx().log
116116
).publishAll(

0 commit comments

Comments
 (0)