diff options
| author | martin-s <webmaster@macside.net> | 2019-07-02 05:51:07 +0000 |
|---|---|---|
| committer | Victor Romero <romerosanchezv@gmail.com> | 2019-07-01 22:51:07 -0700 |
| commit | 91da4aab4c74af1d30c68896a058100257910e8d (patch) | |
| tree | bdd4457dec608a07691c6b8b5ca075b652c051f9 /toolsrc/src/vcpkg.cpp | |
| parent | 96994f8edeace0064b8d80489643e3cb79514390 (diff) | |
| download | vcpkg-91da4aab4c74af1d30c68896a058100257910e8d.tar.gz vcpkg-91da4aab4c74af1d30c68896a058100257910e8d.zip | |
Allow redirection of the scripts folder. (#6552)
* Allow redirection of the scripts folder with an environment variable.
* - Updated feature from environment variable to argument.
* Fix crash when no scripts override is given and use --scripts-root=<PATH> format
* Update help messages to use --scripts-root=<PATH> format
Diffstat (limited to 'toolsrc/src/vcpkg.cpp')
| -rw-r--r-- | toolsrc/src/vcpkg.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 5da97b136..363b39814 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -116,9 +116,19 @@ static void inner(const VcpkgCmdArguments& args) Debug::print("Using vcpkg-root: ", vcpkg_root_dir.u8string(), '\n'); + Optional<fs::path> vcpkg_scripts_root_dir = nullopt; + if (nullptr != args.scripts_root_dir) + { + vcpkg_scripts_root_dir = fs::stdfs::canonical(fs::u8path(*args.scripts_root_dir)); + Debug::print("Using scripts-root: ", vcpkg_scripts_root_dir.value_or_exit(VCPKG_LINE_INFO).u8string(), '\n'); + } + auto default_vs_path = System::get_environment_variable("VCPKG_VISUAL_STUDIO_PATH").value_or(""); + + const Expected<VcpkgPaths> expected_paths = VcpkgPaths::create(vcpkg_root_dir, + vcpkg_scripts_root_dir, default_vs_path, args.overlay_triplets.get()); Checks::check_exit(VCPKG_LINE_INFO, |
