[CI] Fix too early deletion of files

This commit is contained in:
Alexander Karatarakis 2018-02-21 19:57:14 -08:00
parent 35e19d5926
commit e02c9e5354
2 changed files with 9 additions and 10 deletions

View File

@ -399,16 +399,6 @@ namespace vcpkg::Build
} }
} }
if (config.build_package_options.clean_packages == CleanPackages::YES)
{
auto& fs = paths.get_filesystem();
const PackageSpec spec = PackageSpec::from_name_and_triplet(config.scf.core_paragraph->name, config.triplet)
.value_or_exit(VCPKG_LINE_INFO);
const fs::path package_dir = paths.package_dir(spec);
std::error_code ec;
fs.remove_all(package_dir, ec);
}
return result; return result;
} }

View File

@ -308,6 +308,15 @@ namespace vcpkg::Install
auto bcf = std::make_unique<BinaryControlFile>( auto bcf = std::make_unique<BinaryControlFile>(
Paragraphs::try_load_cached_control_package(paths, action.spec).value_or_exit(VCPKG_LINE_INFO)); Paragraphs::try_load_cached_control_package(paths, action.spec).value_or_exit(VCPKG_LINE_INFO));
auto code = aux_install(display_name_with_features, *bcf); auto code = aux_install(display_name_with_features, *bcf);
if (action.build_options.clean_packages == Build::CleanPackages::YES)
{
auto& fs = paths.get_filesystem();
const fs::path package_dir = paths.package_dir(action.spec);
std::error_code ec;
fs.remove_all(package_dir, ec);
}
return {code, std::move(bcf)}; return {code, std::move(bcf)};
} }