aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/commands_edit.cpp
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-04-14 16:07:54 -0700
committerRobert Schumacher <roschuma@microsoft.com>2017-04-14 16:07:54 -0700
commit20397fc845fac398a1aca2ee17ce5b932fc1a83b (patch)
tree51235bc2602a81a89da9605272a37ca4fc1765a8 /toolsrc/src/commands_edit.cpp
parent8183671a492aa21ec20780a77f923848b0aeca41 (diff)
parent1c08a42091cb0addd1e0c1daf27d24bf4e9d237f (diff)
downloadvcpkg-20397fc845fac398a1aca2ee17ce5b932fc1a83b.tar.gz
vcpkg-20397fc845fac398a1aca2ee17ce5b932fc1a83b.zip
Merge branch 'dev/roschuma/fs-testing'
Diffstat (limited to 'toolsrc/src/commands_edit.cpp')
-rw-r--r--toolsrc/src/commands_edit.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp
index 8549f5073..4679a2465 100644
--- a/toolsrc/src/commands_edit.cpp
+++ b/toolsrc/src/commands_edit.cpp
@@ -7,13 +7,15 @@ namespace vcpkg::Commands::Edit
{
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths)
{
+ 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::string port_name = args.command_arguments.at(0);
const fs::path portpath = paths.ports / port_name;
- Checks::check_exit(VCPKG_LINE_INFO, fs::is_directory(portpath), R"(Could not find port named "%s")", port_name);
+ Checks::check_exit(VCPKG_LINE_INFO, fs.is_directory(portpath), R"(Could not find port named "%s")", port_name);
// Find the user's selected editor
std::wstring env_EDITOR;
@@ -30,7 +32,7 @@ namespace vcpkg::Commands::Edit
if (env_EDITOR.empty())
{
const fs::path CODE_EXE_PATH = System::get_ProgramFiles_32_bit() / "Microsoft VS Code/Code.exe";
- if (fs::exists(CODE_EXE_PATH))
+ if (fs.exists(CODE_EXE_PATH))
{
env_EDITOR = CODE_EXE_PATH;
}
@@ -50,13 +52,13 @@ namespace vcpkg::Commands::Edit
if (auto c = code_installpath.get())
{
auto p = fs::path(*c) / "Code.exe";
- if (fs::exists(p))
+ if (fs.exists(p))
{
env_EDITOR = p.native();
break;
}
auto p_insiders = fs::path(*c) / "Code - Insiders.exe";
- if (fs::exists(p_insiders))
+ if (fs.exists(p_insiders))
{
env_EDITOR = p_insiders.native();
break;