Skip to content

Commit

Permalink
[vcpkg-export-ifw] Some improvements
Browse files Browse the repository at this point in the history
Improvements:
- fix typos;
- remove outdated repository directory.
  • Loading branch information
podsvirov committed Sep 27, 2017
1 parent c6149fa commit d25fd5c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions toolsrc/src/commands_export_ifw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace vcpkg::Commands::Export::IFW

fs::path get_repository_dir_path(const std::string &export_id, const Options &ifw_options, const VcpkgPaths& paths)
{
return ifw_options.maybe_packages_dir_path.has_value() ?
return ifw_options.maybe_repository_dir_path.has_value() ?
fs::path(ifw_options.maybe_repository_dir_path.value_or_exit(VCPKG_LINE_INFO))
: paths.root / (export_id + "-ifw-repository");
}
Expand All @@ -49,7 +49,7 @@ namespace vcpkg::Commands::Export::IFW

fs::path get_installer_file_path(const std::string &export_id, const Options &ifw_options, const VcpkgPaths& paths)
{
return ifw_options.maybe_config_file_path.has_value() ?
return ifw_options.maybe_installer_file_path.has_value() ?
fs::path(ifw_options.maybe_installer_file_path.value_or_exit(VCPKG_LINE_INFO))
: paths.root / (export_id + "-ifw-installer.exe");
}
Expand Down Expand Up @@ -279,6 +279,15 @@ R"###(<?xml version="1.0"?>

System::println("Generating repository %s...", repository_dir.generic_string());

std::error_code ec;
Files::Filesystem& fs = paths.get_filesystem();

fs.remove_all(repository_dir, ec);
Checks::check_exit(VCPKG_LINE_INFO,
!ec,
"Could not remove outdated repository directory %s",
repository_dir.generic_string());

const std::wstring cmd_line =
Strings::wformat(LR"("%s" --packages "%s" "%s" > nul)",
repogen_exe.native(),
Expand Down

0 comments on commit d25fd5c

Please sign in to comment.