mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Warnings.
This commit is contained in:
parent
7818280538
commit
0d75f9ad5f
1 changed files with 3 additions and 3 deletions
|
@ -188,12 +188,12 @@ class KFiles {
|
||||||
} else {
|
} else {
|
||||||
val relPath = src.relativeTo(from)
|
val relPath = src.relativeTo(from)
|
||||||
val dstFile = File(dst, relPath)
|
val dstFile = File(dst, relPath)
|
||||||
if (dstFile.exists() && !replaceExisting && !(src.isDirectory() && dstFile.isDirectory())) {
|
if (dstFile.exists() && !replaceExisting && !(src.isDirectory && dstFile.isDirectory)) {
|
||||||
if (onError(dstFile, FileAlreadyExistsException(file = src,
|
if (onError(dstFile, FileAlreadyExistsException(file = src,
|
||||||
other = dstFile,
|
other = dstFile,
|
||||||
reason = "The destination file already exists")) == OnErrorAction.TERMINATE)
|
reason = "The destination file already exists")) == OnErrorAction.TERMINATE)
|
||||||
return false
|
return false
|
||||||
} else if (src.isDirectory()) {
|
} else if (src.isDirectory) {
|
||||||
dstFile.mkdirs()
|
dstFile.mkdirs()
|
||||||
} else {
|
} else {
|
||||||
if (src.copyTo(dstFile, true) != src.length()) {
|
if (src.copyTo(dstFile, true) != src.length()) {
|
||||||
|
@ -239,7 +239,7 @@ class KFiles {
|
||||||
|
|
||||||
fun copy(from: Path?, to: Path?, option: StandardCopyOption = StandardCopyOption.REPLACE_EXISTING) {
|
fun copy(from: Path?, to: Path?, option: StandardCopyOption = StandardCopyOption.REPLACE_EXISTING) {
|
||||||
if (isWindows() && to!!.toFile().exists()) {
|
if (isWindows() && to!!.toFile().exists()) {
|
||||||
log(2, "Windows detected, not overwriting ${to}")
|
log(2, "Windows detected, not overwriting $to")
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
log(2, "Copy from $from to ${to!!}")
|
log(2, "Copy from $from to ${to!!}")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue