From 25b9a3c3cc21ead1c172776b95ad2d7a4a1afdf5 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Tue, 11 Jul 2023 18:31:34 +0300 Subject: [PATCH] update uploads --- snark-gradle-plugin/build.gradle.kts | 2 +- snark-gradle-plugin/src/main/kotlin/uploads.kt | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/snark-gradle-plugin/build.gradle.kts b/snark-gradle-plugin/build.gradle.kts index 0216301..24c4639 100644 --- a/snark-gradle-plugin/build.gradle.kts +++ b/snark-gradle-plugin/build.gradle.kts @@ -11,7 +11,7 @@ repositories{ dependencies{ implementation(spclibs.kotlin.gradle) - implementation("com.github.mwiede:jsch:0.2.1") + implementation("com.github.mwiede:jsch:0.2.9") } gradlePlugin{ diff --git a/snark-gradle-plugin/src/main/kotlin/uploads.kt b/snark-gradle-plugin/src/main/kotlin/uploads.kt index a9c50b4..491bc63 100644 --- a/snark-gradle-plugin/src/main/kotlin/uploads.kt +++ b/snark-gradle-plugin/src/main/kotlin/uploads.kt @@ -14,7 +14,7 @@ private fun ChannelSftp.recursiveFolderUpload(sourceFile: File, destinationPath: cd(destinationPath) if (!sourceFile.name.startsWith(".")) put( FileInputStream(sourceFile), - sourceFile.getName(), + sourceFile.name, ChannelSftp.OVERWRITE ) } else { @@ -32,13 +32,13 @@ private fun ChannelSftp.recursiveFolderUpload(sourceFile: File, destinationPath: // else create a directory if (attrs != null) { - println("Directory $directoryPath exists IsDir=${attrs.isDir()}") + println("Directory $directoryPath exists IsDir=${attrs.isDir}") } else { println("Creating directory $directoryPath") - mkdir(sourceFile.getName()) + mkdir(sourceFile.name) } for (f in files) { - recursiveFolderUpload(f, destinationPath + "/" + sourceFile.getName()) + recursiveFolderUpload(f, destinationPath + "/" + sourceFile.name) } } }