diff --git a/os/src/FileOps.scala b/os/src/FileOps.scala index ad1c2230..705b6982 100644 --- a/os/src/FileOps.scala +++ b/os/src/FileOps.scala @@ -202,7 +202,9 @@ object copy { def copyOne(p: Path): Unit = { val target = to / p.relativeTo(from) - if (mergeFolders && isDir(p, followLinks) && isDir(target, followLinks)) { + if (mergeFolders && isDir(p, false) && !exists(target, false)) { + os.makeDir(target) + } else if (mergeFolders && isDir(p, followLinks) && isDir(target, followLinks)) { // nothing to do } else { Files.copy(p.wrapped, target.wrapped, opts1 ++ opts2 ++ opts3: _*)