зеркало из https://github.com/microsoft/vcpkg.git
Rename optional::get_or_exit() to optional::value_or_exit()
This commit is contained in:
Родитель
c5950aa651
Коммит
7d4832c6bf
|
@ -22,13 +22,13 @@ namespace vcpkg
|
|||
|
||||
optional(T&& t) : m_is_present(true), m_t(std::move(t)) { }
|
||||
|
||||
T&& get_or_exit(const LineInfo& line_info) &&
|
||||
T&& value_or_exit(const LineInfo& line_info) &&
|
||||
{
|
||||
this->exit_if_null(line_info);
|
||||
return std::move(this->m_t);
|
||||
}
|
||||
|
||||
const T& get_or_exit(const LineInfo& line_info) const &
|
||||
const T& value_or_exit(const LineInfo& line_info) const &
|
||||
{
|
||||
this->exit_if_null(line_info);
|
||||
return this->m_t;
|
||||
|
|
|
@ -62,7 +62,7 @@ namespace vcpkg::Commands::CI
|
|||
}
|
||||
else if (action.plan.plan_type == install_plan_type::BUILD_AND_INSTALL)
|
||||
{
|
||||
const BuildResult result = Commands::Build::build_package(action.plan.source_pgh.get_or_exit(VCPKG_LINE_INFO),
|
||||
const BuildResult result = Commands::Build::build_package(action.plan.source_pgh.value_or_exit(VCPKG_LINE_INFO),
|
||||
action.spec,
|
||||
paths,
|
||||
paths.port_dir(action.spec),
|
||||
|
@ -81,7 +81,7 @@ namespace vcpkg::Commands::CI
|
|||
else if (action.plan.plan_type == install_plan_type::INSTALL)
|
||||
{
|
||||
results.back() = BuildResult::SUCCEEDED;
|
||||
Install::install_package(paths, action.plan.binary_pgh.get_or_exit(VCPKG_LINE_INFO), &status_db);
|
||||
Install::install_package(paths, action.plan.binary_pgh.value_or_exit(VCPKG_LINE_INFO), &status_db);
|
||||
System::println(System::color::success, "Package %s is installed from cache", action.spec);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -216,7 +216,7 @@ namespace vcpkg::Commands::Install
|
|||
}
|
||||
else if (action.plan.plan_type == install_plan_type::BUILD_AND_INSTALL)
|
||||
{
|
||||
const Build::BuildResult result = Commands::Build::build_package(action.plan.source_pgh.get_or_exit(VCPKG_LINE_INFO),
|
||||
const Build::BuildResult result = Commands::Build::build_package(action.plan.source_pgh.value_or_exit(VCPKG_LINE_INFO),
|
||||
action.spec,
|
||||
paths,
|
||||
paths.port_dir(action.spec),
|
||||
|
@ -233,7 +233,7 @@ namespace vcpkg::Commands::Install
|
|||
}
|
||||
else if (action.plan.plan_type == install_plan_type::INSTALL)
|
||||
{
|
||||
install_package(paths, action.plan.binary_pgh.get_or_exit(VCPKG_LINE_INFO), &status_db);
|
||||
install_package(paths, action.plan.binary_pgh.value_or_exit(VCPKG_LINE_INFO), &status_db);
|
||||
System::println(System::color::success, "Package %s is installed", action.spec);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -136,7 +136,7 @@ namespace vcpkg::Commands::Integrate
|
|||
|
||||
static fs::path get_appdata_targets_path()
|
||||
{
|
||||
static const fs::path local_app_data = fs::path(System::get_environmental_variable(L"LOCALAPPDATA").get_or_exit(VCPKG_LINE_INFO));
|
||||
static const fs::path local_app_data = fs::path(System::get_environmental_variable(L"LOCALAPPDATA").value_or_exit(VCPKG_LINE_INFO));
|
||||
return local_app_data / "vcpkg" / "vcpkg.user.targets";
|
||||
}
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ namespace vcpkg::Environment
|
|||
|
||||
static const fs::path& get_ProgramFiles()
|
||||
{
|
||||
static const fs::path p = System::get_environmental_variable(L"PROGRAMFILES").get_or_exit(VCPKG_LINE_INFO);
|
||||
static const fs::path p = System::get_environmental_variable(L"PROGRAMFILES").value_or_exit(VCPKG_LINE_INFO);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace vcpkg::System
|
|||
|
||||
int cmd_execute_clean(const cwstring_view cmd_line)
|
||||
{
|
||||
static const std::wstring system_root = get_environmental_variable(L"SystemRoot").get_or_exit(VCPKG_LINE_INFO);
|
||||
static const std::wstring system_root = get_environmental_variable(L"SystemRoot").value_or_exit(VCPKG_LINE_INFO);
|
||||
static const std::wstring system_32 = system_root + LR"(\system32)";
|
||||
static const std::wstring new_PATH = Strings::wformat(LR"(Path=%s;%s;%s\WindowsPowerShell\v1.0\)", system_32, system_root, system_32);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче