update uploads

This commit is contained in:
Alexander Nozik 2023-07-11 18:31:34 +03:00
parent 3fb1a968e5
commit 25b9a3c3cc
2 changed files with 5 additions and 5 deletions

View File

@ -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{

View File

@ -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)
}
}
}