Override existing symlinks when adding packages to repo

This commit is contained in:
Martchus 2021-11-03 16:06:16 +01:00
parent 755e1958d3
commit 893a8473ad
1 changed files with 1 additions and 3 deletions

View File

@ -1103,9 +1103,7 @@ void ConductBuild::addPackageToRepo(
}
std::filesystem::copy(binaryPackage.path, anyRepoPath / binaryPackage.fileName, std::filesystem::copy_options::overwrite_existing);
const auto symlink = std::filesystem::path(*buildResult.repoPath % '/' + binaryPackage.fileName);
if (std::filesystem::exists(symlink) && !std::filesystem::is_symlink(symlink)) {
std::filesystem::remove(symlink);
}
std::filesystem::remove(symlink);
std::filesystem::create_symlink("../any/" + binaryPackage.fileName, symlink);
}
} catch (const std::filesystem::filesystem_error &e) {