update uploads
This commit is contained in:
parent
3fb1a968e5
commit
25b9a3c3cc
@ -11,7 +11,7 @@ repositories{
|
|||||||
|
|
||||||
dependencies{
|
dependencies{
|
||||||
implementation(spclibs.kotlin.gradle)
|
implementation(spclibs.kotlin.gradle)
|
||||||
implementation("com.github.mwiede:jsch:0.2.1")
|
implementation("com.github.mwiede:jsch:0.2.9")
|
||||||
}
|
}
|
||||||
|
|
||||||
gradlePlugin{
|
gradlePlugin{
|
||||||
|
@ -14,7 +14,7 @@ private fun ChannelSftp.recursiveFolderUpload(sourceFile: File, destinationPath:
|
|||||||
cd(destinationPath)
|
cd(destinationPath)
|
||||||
if (!sourceFile.name.startsWith(".")) put(
|
if (!sourceFile.name.startsWith(".")) put(
|
||||||
FileInputStream(sourceFile),
|
FileInputStream(sourceFile),
|
||||||
sourceFile.getName(),
|
sourceFile.name,
|
||||||
ChannelSftp.OVERWRITE
|
ChannelSftp.OVERWRITE
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
@ -32,13 +32,13 @@ private fun ChannelSftp.recursiveFolderUpload(sourceFile: File, destinationPath:
|
|||||||
|
|
||||||
// else create a directory
|
// else create a directory
|
||||||
if (attrs != null) {
|
if (attrs != null) {
|
||||||
println("Directory $directoryPath exists IsDir=${attrs.isDir()}")
|
println("Directory $directoryPath exists IsDir=${attrs.isDir}")
|
||||||
} else {
|
} else {
|
||||||
println("Creating directory $directoryPath")
|
println("Creating directory $directoryPath")
|
||||||
mkdir(sourceFile.getName())
|
mkdir(sourceFile.name)
|
||||||
}
|
}
|
||||||
for (f in files) {
|
for (f in files) {
|
||||||
recursiveFolderUpload(f, destinationPath + "/" + sourceFile.getName())
|
recursiveFolderUpload(f, destinationPath + "/" + sourceFile.name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user