Fix typo in constructor parameter name (#162)

Breaking change: changes param name `noTranstive` to `noTransitive`.
This commit is contained in:
translatenix
2024-02-15 09:35:21 -08:00
committed by GitHub
parent c3473cc626
commit 810a755702
2 changed files with 10 additions and 10 deletions
@@ -24,7 +24,7 @@ import org.pkl.core.packages.PackageUri
class CliDownloadPackageCommand( class CliDownloadPackageCommand(
baseOptions: CliBaseOptions, baseOptions: CliBaseOptions,
private val packageUris: List<PackageUri>, private val packageUris: List<PackageUri>,
private val noTranstive: Boolean private val noTransitive: Boolean
) : CliCommand(baseOptions) { ) : CliCommand(baseOptions) {
override fun doRun() { override fun doRun() {
@@ -35,7 +35,7 @@ class CliDownloadPackageCommand(
val errors = mutableMapOf<PackageUri, Throwable>() val errors = mutableMapOf<PackageUri, Throwable>()
for (pkg in packageUris) { for (pkg in packageUris) {
try { try {
packageResolver.downloadPackage(pkg, pkg.checksums, noTranstive) packageResolver.downloadPackage(pkg, pkg.checksums, noTransitive)
} catch (e: Throwable) { } catch (e: Throwable) {
errors[pkg] = e errors[pkg] = e
} }
@@ -50,7 +50,7 @@ class CliDownloadPackageCommandTest {
PackageUri("package://localhost:12110/fruit@1.0.5"), PackageUri("package://localhost:12110/fruit@1.0.5"),
PackageUri("package://localhost:12110/fruit@1.1.0") PackageUri("package://localhost:12110/fruit@1.1.0")
), ),
noTranstive = true noTransitive = true
) )
cmd.run() cmd.run()
assertThat(tempDir.resolve("package-1/localhost:12110/birds@0.5.0/birds@0.5.0.zip")).exists() 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) caCertificates = listOf(FileTestUtils.selfSignedCertificate)
), ),
packageUris = listOf(PackageUri("package://localhost:12110/birds@0.5.0")), packageUris = listOf(PackageUri("package://localhost:12110/birds@0.5.0")),
noTranstive = true noTransitive = true
) )
cmd.run() cmd.run()
assertThat(tempDir.resolve(".my-cache/package-1/localhost:12110/birds@0.5.0/birds@0.5.0.zip")) 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" "package://localhost:12110/birds@0.5.0::sha256:3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118"
), ),
), ),
noTranstive = true noTransitive = true
) )
cmd.run() cmd.run()
assertThat(tempDir.resolve("package-1/localhost:12110/birds@0.5.0/birds@0.5.0.zip")).exists() assertThat(tempDir.resolve("package-1/localhost:12110/birds@0.5.0/birds@0.5.0.zip")).exists()
@@ -127,7 +127,7 @@ class CliDownloadPackageCommandTest {
listOf( listOf(
PackageUri("package://localhost:12110/birds@0.5.0::sha256:intentionallyBogusChecksum"), PackageUri("package://localhost:12110/birds@0.5.0::sha256:intentionallyBogusChecksum"),
), ),
noTranstive = true noTransitive = true
) )
assertThatCode { cmd.run() } assertThatCode { cmd.run() }
.hasMessage( .hasMessage(
@@ -148,7 +148,7 @@ class CliDownloadPackageCommandTest {
CliDownloadPackageCommand( CliDownloadPackageCommand(
baseOptions = CliBaseOptions(workingDir = tempDir, noCache = true), baseOptions = CliBaseOptions(workingDir = tempDir, noCache = true),
packageUris = listOf(PackageUri("package://localhost:12110/birds@0.5.0")), packageUris = listOf(PackageUri("package://localhost:12110/birds@0.5.0")),
noTranstive = true noTransitive = true
) )
assertThatCode { cmd.run() } assertThatCode { cmd.run() }
.hasMessage("Cannot download packages because no cache directory is specified.") .hasMessage("Cannot download packages because no cache directory is specified.")
@@ -164,7 +164,7 @@ class CliDownloadPackageCommandTest {
caCertificates = listOf(FileTestUtils.selfSignedCertificate) caCertificates = listOf(FileTestUtils.selfSignedCertificate)
), ),
packageUris = listOf(PackageUri("package://localhost:12110/badChecksum@1.0.0")), packageUris = listOf(PackageUri("package://localhost:12110/badChecksum@1.0.0")),
noTranstive = true noTransitive = true
) )
assertThatCode { cmd.run() } assertThatCode { cmd.run() }
.hasMessageStartingWith( .hasMessageStartingWith(
@@ -186,7 +186,7 @@ class CliDownloadPackageCommandTest {
PackageUri("package://localhost:12110/badChecksum@1.0.0"), PackageUri("package://localhost:12110/badChecksum@1.0.0"),
PackageUri("package://bogus.domain/notAPackage@1.0.0") PackageUri("package://bogus.domain/notAPackage@1.0.0")
), ),
noTranstive = true noTransitive = true
) )
assertThatCode { cmd.run() } assertThatCode { cmd.run() }
.hasMessage( .hasMessage(
@@ -218,7 +218,7 @@ class CliDownloadPackageCommandTest {
caCertificates = listOf(FileTestUtils.selfSignedCertificate) caCertificates = listOf(FileTestUtils.selfSignedCertificate)
), ),
packageUris = listOf(PackageUri("package://localhost:12110/birds@0.5.0")), packageUris = listOf(PackageUri("package://localhost:12110/birds@0.5.0")),
noTranstive = false noTransitive = false
) )
.run() .run()
assertThat(tempDir.resolve("package-1/localhost:12110/birds@0.5.0/birds@0.5.0.zip")).exists() assertThat(tempDir.resolve("package-1/localhost:12110/birds@0.5.0/birds@0.5.0.zip")).exists()