From 810a755702b54309cd206e6835cc0c8c621d782e Mon Sep 17 00:00:00 2001 From: translatenix <119817707+translatenix@users.noreply.github.com> Date: Thu, 15 Feb 2024 09:35:21 -0800 Subject: [PATCH] Fix typo in constructor parameter name (#162) Breaking change: changes param name `noTranstive` to `noTransitive`. --- .../org/pkl/cli/CliDownloadPackageCommand.kt | 4 ++-- .../org/pkl/cli/CliDownloadPackageCommandTest.kt | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pkl-cli/src/main/kotlin/org/pkl/cli/CliDownloadPackageCommand.kt b/pkl-cli/src/main/kotlin/org/pkl/cli/CliDownloadPackageCommand.kt index 68c2c367..c4ddb0dd 100644 --- a/pkl-cli/src/main/kotlin/org/pkl/cli/CliDownloadPackageCommand.kt +++ b/pkl-cli/src/main/kotlin/org/pkl/cli/CliDownloadPackageCommand.kt @@ -24,7 +24,7 @@ import org.pkl.core.packages.PackageUri class CliDownloadPackageCommand( baseOptions: CliBaseOptions, private val packageUris: List, - private val noTranstive: Boolean + private val noTransitive: Boolean ) : CliCommand(baseOptions) { override fun doRun() { @@ -35,7 +35,7 @@ class CliDownloadPackageCommand( val errors = mutableMapOf() for (pkg in packageUris) { try { - packageResolver.downloadPackage(pkg, pkg.checksums, noTranstive) + packageResolver.downloadPackage(pkg, pkg.checksums, noTransitive) } catch (e: Throwable) { errors[pkg] = e } diff --git a/pkl-cli/src/test/kotlin/org/pkl/cli/CliDownloadPackageCommandTest.kt b/pkl-cli/src/test/kotlin/org/pkl/cli/CliDownloadPackageCommandTest.kt index 50c469ae..103ef1be 100644 --- a/pkl-cli/src/test/kotlin/org/pkl/cli/CliDownloadPackageCommandTest.kt +++ b/pkl-cli/src/test/kotlin/org/pkl/cli/CliDownloadPackageCommandTest.kt @@ -50,7 +50,7 @@ class CliDownloadPackageCommandTest { PackageUri("package://localhost:12110/fruit@1.0.5"), PackageUri("package://localhost:12110/fruit@1.1.0") ), - noTranstive = true + noTransitive = true ) cmd.run() assertThat(tempDir.resolve("package-1/localhost:12110/birds@0.5.0/birds@0.5.0.zip")).exists() @@ -83,7 +83,7 @@ class CliDownloadPackageCommandTest { caCertificates = listOf(FileTestUtils.selfSignedCertificate) ), packageUris = listOf(PackageUri("package://localhost:12110/birds@0.5.0")), - noTranstive = true + noTransitive = true ) cmd.run() assertThat(tempDir.resolve(".my-cache/package-1/localhost:12110/birds@0.5.0/birds@0.5.0.zip")) @@ -107,7 +107,7 @@ class CliDownloadPackageCommandTest { "package://localhost:12110/birds@0.5.0::sha256:3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118" ), ), - noTranstive = true + noTransitive = true ) cmd.run() assertThat(tempDir.resolve("package-1/localhost:12110/birds@0.5.0/birds@0.5.0.zip")).exists() @@ -127,7 +127,7 @@ class CliDownloadPackageCommandTest { listOf( PackageUri("package://localhost:12110/birds@0.5.0::sha256:intentionallyBogusChecksum"), ), - noTranstive = true + noTransitive = true ) assertThatCode { cmd.run() } .hasMessage( @@ -148,7 +148,7 @@ class CliDownloadPackageCommandTest { CliDownloadPackageCommand( baseOptions = CliBaseOptions(workingDir = tempDir, noCache = true), packageUris = listOf(PackageUri("package://localhost:12110/birds@0.5.0")), - noTranstive = true + noTransitive = true ) assertThatCode { cmd.run() } .hasMessage("Cannot download packages because no cache directory is specified.") @@ -164,7 +164,7 @@ class CliDownloadPackageCommandTest { caCertificates = listOf(FileTestUtils.selfSignedCertificate) ), packageUris = listOf(PackageUri("package://localhost:12110/badChecksum@1.0.0")), - noTranstive = true + noTransitive = true ) assertThatCode { cmd.run() } .hasMessageStartingWith( @@ -186,7 +186,7 @@ class CliDownloadPackageCommandTest { PackageUri("package://localhost:12110/badChecksum@1.0.0"), PackageUri("package://bogus.domain/notAPackage@1.0.0") ), - noTranstive = true + noTransitive = true ) assertThatCode { cmd.run() } .hasMessage( @@ -218,7 +218,7 @@ class CliDownloadPackageCommandTest { caCertificates = listOf(FileTestUtils.selfSignedCertificate) ), packageUris = listOf(PackageUri("package://localhost:12110/birds@0.5.0")), - noTranstive = false + noTransitive = false ) .run() assertThat(tempDir.resolve("package-1/localhost:12110/birds@0.5.0/birds@0.5.0.zip")).exists()