Projet

Général

Profil

Bug #13145 » 99-blogaddfile.groovy

Marc Avenel, 27/09/2022 09:34

 
import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.Paths
import java.nio.file.StandardCopyOption

/** Script to copy file(s) */
log.info 'Copy patch blog add image.. #13145'
Path srcFiles = "${settings.SILVERPEAS_HOME}/patch13145/".asPath()
Path destFiles = "${settings.SILVERPEAS_HOME}/bin/build/dist/util/javascript/".asPath()
if (Files.isDirectory(srcFiles)) {
srcFiles.toFile().eachFileMatch(~/.*/)
{
File srcFile = new File(it.name, srcFiles.toFile())
File destFile = new File(srcFile.name, destFiles.toFile())
log.info " ${srcFile} -> ${destFile}"
Files.copy(srcFile.toPath(),destFile.toPath(),StandardCopyOption.REPLACE_EXISTING)
}
}
(3-3/3)