diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-08-23 15:58:12 -0700 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-08-23 15:58:12 -0700 |
| commit | 5fb5f65ccd8d9cfead29d283a75a0e7acd77ced1 (patch) | |
| tree | 719e2440412576786782b2a4ab85d9687ef5b09c /toolsrc/src | |
| parent | 30d2cb9debccf0bcaa1d61cedefae400fdf07951 (diff) | |
| parent | 79365783d04166cd1b463dd4142c992b496fbbd3 (diff) | |
| download | vcpkg-5fb5f65ccd8d9cfead29d283a75a0e7acd77ced1.tar.gz vcpkg-5fb5f65ccd8d9cfead29d283a75a0e7acd77ced1.zip | |
Merge branch 'master' of https://github.com/Microsoft/vcpkg
Diffstat (limited to 'toolsrc/src')
| -rw-r--r-- | toolsrc/src/commands_edit.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp index 12ddaad77..72005a461 100644 --- a/toolsrc/src/commands_edit.cpp +++ b/toolsrc/src/commands_edit.cpp @@ -8,11 +8,14 @@ namespace vcpkg::Commands::Edit { void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { + static const std::string OPTION_BUILDTREES = "--buildtrees"; + auto& fs = paths.get_filesystem(); static const std::string example = Commands::Help::create_example_string("edit zlib"); args.check_exact_arg_count(1, example); - args.check_and_get_optional_command_arguments({}); + const std::unordered_set<std::string> options = + args.check_and_get_optional_command_arguments({OPTION_BUILDTREES}); const std::string port_name = args.command_arguments.at(0); const fs::path portpath = paths.ports / port_name; @@ -84,6 +87,14 @@ namespace vcpkg::Commands::Edit VCPKG_LINE_INFO, "Visual Studio Code was not found and the environment variable EDITOR is not set"); } + if (options.find(OPTION_BUILDTREES) != options.cend()) + { + const auto buildtrees_current_dir = paths.buildtrees / port_name; + + 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)); + } + std::wstring cmdLine = Strings::wformat( LR"("%s" "%s" "%s" -n)", env_EDITOR, portpath.native(), (portpath / "portfile.cmake").native()); Checks::exit_with_code(VCPKG_LINE_INFO, System::cmd_execute(cmdLine)); |
