Skip to content

Commit

Permalink
Handle optional value using null as default param
Browse files Browse the repository at this point in the history
better than using empty string as default param.
  • Loading branch information
Baccata committed May 23, 2018
1 parent 63e49f9 commit ec362d8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scalalib/src/mill/scalalib/PublishModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ trait PublishModule extends JavaModule { outer =>
}

def publish(sonatypeCreds: String,
gpgPassphrase: String = "",
gpgPassphrase: String = null,
signed: Boolean = true,
release: Boolean): define.Command[Unit] = T.command {
val PublishModule.PublishData(artifactInfo, artifacts) = publishArtifacts()
new SonatypePublisher(
sonatypeUri,
sonatypeSnapshotUri,
sonatypeCreds,
Some(gpgPassphrase).filter(_.nonEmpty),
Option(gpgPassphrase),
signed,
T.ctx().log
).publish(artifacts.map{case (a, b) => (a.path, b)}, artifactInfo, release)
Expand All @@ -96,7 +96,7 @@ object PublishModule extends ExternalModule {
}

def publishAll(sonatypeCreds: String,
gpgPassphrase: String = "",
gpgPassphrase: String = null,
signed: Boolean = true,
publishArtifacts: mill.main.Tasks[PublishModule.PublishData],
release: Boolean = false,
Expand All @@ -110,7 +110,7 @@ object PublishModule extends ExternalModule {
sonatypeUri,
sonatypeSnapshotUri,
sonatypeCreds,
Some(gpgPassphrase).filter(_.nonEmpty),
Option(gpgPassphrase),
signed,
T.ctx().log
).publishAll(
Expand Down

0 comments on commit ec362d8

Please sign in to comment.