diff options
| author | Alexander Karatarakis <alex@karatarakis.com> | 2017-09-21 12:22:00 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-21 12:22:00 -0700 |
| commit | fac96eb344a500405ab65b7e7f3755af0ad00b7e (patch) | |
| tree | f9e3376ca1a8f2de408e087e42ae393f224d6c42 /toolsrc/src/vcpkg_Files.cpp | |
| parent | 46db0f03fcb42d9f738474885fda372160362e44 (diff) | |
| parent | 1bbce1ee844262647f994afd5f31da12d938e7ee (diff) | |
| download | vcpkg-fac96eb344a500405ab65b7e7f3755af0ad00b7e.tar.gz vcpkg-fac96eb344a500405ab65b7e7f3755af0ad00b7e.zip | |
Merge branch 'master' into master
Diffstat (limited to 'toolsrc/src/vcpkg_Files.cpp')
| -rw-r--r-- | toolsrc/src/vcpkg_Files.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/toolsrc/src/vcpkg_Files.cpp b/toolsrc/src/vcpkg_Files.cpp index 29da7e684..ad1fcebc6 100644 --- a/toolsrc/src/vcpkg_Files.cpp +++ b/toolsrc/src/vcpkg_Files.cpp @@ -2,6 +2,7 @@ #include "vcpkg_Files.h" #include "vcpkg_System.h" +#include "vcpkg_Util.h" #include <thread> namespace vcpkg::Files @@ -186,11 +187,23 @@ namespace vcpkg::Files void print_paths(const std::vector<fs::path>& paths) { - System::println(""); + System::println(); for (const fs::path& p : paths) { System::println(" %s", p.generic_string()); } - System::println(""); + System::println(); + } + + std::vector<fs::path> find_from_PATH(const std::wstring& name) + { + const std::wstring cmd = Strings::wformat(L"where.exe %s", name); + auto out = System::cmd_execute_and_capture_output(cmd); + if (out.exit_code != 0) + { + return {}; + } + + return Util::fmap(Strings::split(out.output, "\n"), [](auto&& s) { return fs::path(s); }); } } |
