diff --git a/source/dub/internal/vibecompat/core/file.d b/source/dub/internal/vibecompat/core/file.d index 3ff04b4..1414329 100644 --- a/source/dub/internal/vibecompat/core/file.d +++ b/source/dub/internal/vibecompat/core/file.d @@ -109,7 +109,12 @@ */ void copyFile(Path from, Path to, bool overwrite = false) { - enforce(overwrite || !existsFile(to), "Destination file already exists."); + if (existsFile(to)) { + enforce(overwrite, "Destination file already exists."); + // remove file before copy to allow "overwriting" files that are in + // use on Linux + removeFile(to); + } .copy(from.toNativeString(), to.toNativeString()); } /// ditto