aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-02-14 13:21:30 -0800
committerAlexander Karatarakis <alkarata@microsoft.com>2017-02-14 13:21:30 -0800
commitc11b2c790e0260434d057cd5fbeccd59f36732c7 (patch)
tree170c5bfcb655374356d32525442c08fc8de6d751 /toolsrc/src
parent8aa82bb8957cb5b76ad1d1209cf675b2eba7401d (diff)
downloadvcpkg-c11b2c790e0260434d057cd5fbeccd59f36732c7.tar.gz
vcpkg-c11b2c790e0260434d057cd5fbeccd59f36732c7.zip
Rename wdupenv_str to get_environmental_variable()
Diffstat (limited to 'toolsrc/src')
-rw-r--r--toolsrc/src/commands_edit.cpp2
-rw-r--r--toolsrc/src/commands_integrate.cpp2
-rw-r--r--toolsrc/src/vcpkg.cpp4
-rw-r--r--toolsrc/src/vcpkg_Environment.cpp8
-rw-r--r--toolsrc/src/vcpkg_System.cpp2
5 files changed, 9 insertions, 9 deletions
diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp
index dff30f7ad..a25a9e4dc 100644
--- a/toolsrc/src/commands_edit.cpp
+++ b/toolsrc/src/commands_edit.cpp
@@ -15,7 +15,7 @@ namespace vcpkg::Commands::Edit
Checks::check_exit(fs::is_directory(portpath), R"(Could not find port named "%s")", port_name);
// Find editor
- std::wstring env_EDITOR = System::wdupenv_str(L"EDITOR");
+ std::wstring env_EDITOR = System::get_environmental_variable(L"EDITOR");
if (env_EDITOR.empty())
{
static const std::wstring CODE_EXE_PATH = LR"(C:\Program Files (x86)\Microsoft VS Code\Code.exe)";
diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/commands_integrate.cpp
index 03c51b5a7..93fb29487 100644
--- a/toolsrc/src/commands_integrate.cpp
+++ b/toolsrc/src/commands_integrate.cpp
@@ -136,7 +136,7 @@ namespace vcpkg::Commands::Integrate
static fs::path get_appdata_targets_path()
{
- return fs::path(System::wdupenv_str(L"LOCALAPPDATA")) / "vcpkg" / "vcpkg.user.targets";
+ return fs::path(System::get_environmental_variable(L"LOCALAPPDATA")) / "vcpkg" / "vcpkg.user.targets";
}
static void integrate_install(const vcpkg_paths& paths)
diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp
index 3e313c702..27a34b80d 100644
--- a/toolsrc/src/vcpkg.cpp
+++ b/toolsrc/src/vcpkg.cpp
@@ -47,7 +47,7 @@ static void inner(const vcpkg_cmd_arguments& args)
}
else
{
- auto vcpkg_root_dir_env = System::wdupenv_str(L"VCPKG_ROOT");
+ auto vcpkg_root_dir_env = System::get_environmental_variable(L"VCPKG_ROOT");
if (!vcpkg_root_dir_env.empty())
{
@@ -79,7 +79,7 @@ static void inner(const vcpkg_cmd_arguments& args)
}
else
{
- const auto vcpkg_default_triplet_env = System::wdupenv_str(L"VCPKG_DEFAULT_TRIPLET");
+ const auto vcpkg_default_triplet_env = System::get_environmental_variable(L"VCPKG_DEFAULT_TRIPLET");
if (!vcpkg_default_triplet_env.empty())
{
default_target_triplet = triplet::from_canonical_name(Strings::utf16_to_utf8(vcpkg_default_triplet_env));
diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp
index 1babdc547..abde735cb 100644
--- a/toolsrc/src/vcpkg_Environment.cpp
+++ b/toolsrc/src/vcpkg_Environment.cpp
@@ -57,7 +57,7 @@ namespace vcpkg::Environment
const fs::path downloaded_git = paths.downloads / "PortableGit" / "cmd";
const std::wstring path_buf = Strings::wformat(L"%s;%s;%s;%s",
downloaded_git.native(),
- System::wdupenv_str(L"PATH"),
+ System::get_environmental_variable(L"PATH"),
default_git_installation_dir.native(),
default_git_installation_dir_x86.native());
_wputenv_s(L"PATH", path_buf.c_str());
@@ -73,7 +73,7 @@ namespace vcpkg::Environment
const fs::path downloaded_cmake = paths.downloads / "cmake-3.7.2-win32-x86" / "bin";
const std::wstring path_buf = Strings::wformat(L"%s;%s;%s;%s",
downloaded_cmake.native(),
- System::wdupenv_str(L"PATH"),
+ System::get_environmental_variable(L"PATH"),
default_cmake_installation_dir.native(),
default_cmake_installation_dir_x86.native());
_wputenv_s(L"PATH", path_buf.c_str());
@@ -87,7 +87,7 @@ namespace vcpkg::Environment
void ensure_nuget_on_path(const vcpkg_paths& paths)
{
const fs::path downloaded_nuget = paths.downloads / "nuget-3.5.0";
- const std::wstring path_buf = Strings::wformat(L"%s;%s", downloaded_nuget.native(), System::wdupenv_str(L"PATH"));
+ const std::wstring path_buf = Strings::wformat(L"%s;%s", downloaded_nuget.native(), System::get_environmental_variable(L"PATH"));
_wputenv_s(L"PATH", path_buf.c_str());
static constexpr std::array<int, 3> nuget_version = {3,3,0};
@@ -107,7 +107,7 @@ namespace vcpkg::Environment
static const fs::path& get_VS2015_installation_instance()
{
- static const fs::path vs2015_cmntools = fs::path(System::wdupenv_str(L"VS140COMNTOOLS")).parent_path(); // The call to parent_path() is needed because the env variable has a trailing backslash
+ static const fs::path vs2015_cmntools = fs::path(System::get_environmental_variable(L"VS140COMNTOOLS")).parent_path(); // The call to parent_path() is needed because the env variable has a trailing backslash
static const fs::path vs2015_path = vs2015_cmntools.parent_path().parent_path();
return vs2015_path;
}
diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp
index 754a26741..1d9f8e696 100644
--- a/toolsrc/src/vcpkg_System.cpp
+++ b/toolsrc/src/vcpkg_System.cpp
@@ -73,7 +73,7 @@ namespace vcpkg::System
std::cout << "\n";
}
- std::wstring wdupenv_str(const wchar_t* varname) noexcept
+ std::wstring get_environmental_variable(const wchar_t* varname) noexcept
{
std::wstring ret;
wchar_t* buffer;