mirror of
https://github.com/cemu-project/vcpkg.git
synced 2025-02-24 03:27:12 +01:00
Use const
This commit is contained in:
parent
269c6b4d55
commit
4a43e3e7f9
@ -15,7 +15,7 @@ namespace vcpkg::Commands::Cache
|
|||||||
{
|
{
|
||||||
const Expected<std::unordered_map<std::string, std::string>> pghs =
|
const Expected<std::unordered_map<std::string, std::string>> pghs =
|
||||||
Paragraphs::get_single_paragraph(paths.get_filesystem(), path / "CONTROL");
|
Paragraphs::get_single_paragraph(paths.get_filesystem(), path / "CONTROL");
|
||||||
if (auto p = pghs.get())
|
if (const auto p = pghs.get())
|
||||||
{
|
{
|
||||||
const BinaryParagraph binary_paragraph = BinaryParagraph(*p);
|
const BinaryParagraph binary_paragraph = BinaryParagraph(*p);
|
||||||
output.push_back(binary_paragraph);
|
output.push_back(binary_paragraph);
|
||||||
|
@ -46,7 +46,7 @@ namespace vcpkg::Commands::DependInfo
|
|||||||
for (auto&& source_control_file : source_control_files)
|
for (auto&& source_control_file : source_control_files)
|
||||||
{
|
{
|
||||||
const SourceParagraph& source_paragraph = *source_control_file->core_paragraph;
|
const SourceParagraph& source_paragraph = *source_control_file->core_paragraph;
|
||||||
auto s = Strings::join(", ", source_paragraph.depends, [](const Dependency& d) { return d.name(); });
|
const auto s = Strings::join(", ", source_paragraph.depends, [](const Dependency& d) { return d.name(); });
|
||||||
System::println("%s: %s", source_paragraph.name, s);
|
System::println("%s: %s", source_paragraph.name, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ namespace vcpkg::Commands::Edit
|
|||||||
if (env_EDITOR.empty())
|
if (env_EDITOR.empty())
|
||||||
{
|
{
|
||||||
const Optional<std::wstring> env_EDITOR_optional = System::get_environment_variable(L"EDITOR");
|
const Optional<std::wstring> env_EDITOR_optional = System::get_environment_variable(L"EDITOR");
|
||||||
if (auto e = env_EDITOR_optional.get())
|
if (const auto e = env_EDITOR_optional.get())
|
||||||
{
|
{
|
||||||
env_EDITOR = *e;
|
env_EDITOR = *e;
|
||||||
}
|
}
|
||||||
@ -63,7 +63,7 @@ namespace vcpkg::Commands::Edit
|
|||||||
{
|
{
|
||||||
const Optional<std::wstring> code_installpath =
|
const Optional<std::wstring> code_installpath =
|
||||||
System::get_registry_string(HKEY_LOCAL_MACHINE, keypath, L"InstallLocation");
|
System::get_registry_string(HKEY_LOCAL_MACHINE, keypath, L"InstallLocation");
|
||||||
if (auto c = code_installpath.get())
|
if (const auto c = code_installpath.get())
|
||||||
{
|
{
|
||||||
auto p = fs::path(*c) / "Code.exe";
|
auto p = fs::path(*c) / "Code.exe";
|
||||||
if (fs.exists(p))
|
if (fs.exists(p))
|
||||||
@ -91,11 +91,12 @@ namespace vcpkg::Commands::Edit
|
|||||||
{
|
{
|
||||||
const auto buildtrees_current_dir = paths.buildtrees / port_name;
|
const auto buildtrees_current_dir = paths.buildtrees / port_name;
|
||||||
|
|
||||||
std::wstring cmdLine = Strings::wformat(LR"("%s" "%s" -n)", env_EDITOR, buildtrees_current_dir.native());
|
const std::wstring cmdLine =
|
||||||
|
Strings::wformat(LR"("%s" "%s" -n)", env_EDITOR, buildtrees_current_dir.native());
|
||||||
Checks::exit_with_code(VCPKG_LINE_INFO, System::cmd_execute(cmdLine));
|
Checks::exit_with_code(VCPKG_LINE_INFO, System::cmd_execute(cmdLine));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::wstring cmdLine = Strings::wformat(
|
const std::wstring cmdLine = Strings::wformat(
|
||||||
LR"("%s" "%s" "%s" -n)", env_EDITOR, portpath.native(), (portpath / "portfile.cmake").native());
|
LR"("%s" "%s" "%s" -n)", env_EDITOR, portpath.native(), (portpath / "portfile.cmake").native());
|
||||||
Checks::exit_with_code(VCPKG_LINE_INFO, System::cmd_execute(cmdLine));
|
Checks::exit_with_code(VCPKG_LINE_INFO, System::cmd_execute(cmdLine));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user