From ec362d830997943b8509ff33e12f8f9bb7fded15 Mon Sep 17 00:00:00 2001 From: Olivier Melois Date: Wed, 23 May 2018 14:10:04 +0100 Subject: [PATCH] Handle optional value using null as default param better than using empty string as default param. --- scalalib/src/mill/scalalib/PublishModule.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scalalib/src/mill/scalalib/PublishModule.scala b/scalalib/src/mill/scalalib/PublishModule.scala index 6c8eee03e9c..0b7e52c8cc8 100644 --- a/scalalib/src/mill/scalalib/PublishModule.scala +++ b/scalalib/src/mill/scalalib/PublishModule.scala @@ -73,7 +73,7 @@ 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() @@ -81,7 +81,7 @@ trait PublishModule extends JavaModule { outer => sonatypeUri, sonatypeSnapshotUri, sonatypeCreds, - Some(gpgPassphrase).filter(_.nonEmpty), + Option(gpgPassphrase), signed, T.ctx().log ).publish(artifacts.map{case (a, b) => (a.path, b)}, artifactInfo, release) @@ -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, @@ -110,7 +110,7 @@ object PublishModule extends ExternalModule { sonatypeUri, sonatypeSnapshotUri, sonatypeCreds, - Some(gpgPassphrase).filter(_.nonEmpty), + Option(gpgPassphrase), signed, T.ctx().log ).publishAll(