aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/commands_edit.cpp
diff options
context:
space:
mode:
authorThomas Fussell <thomas.fussell@gmail.com>2017-03-17 00:33:06 -0400
committerThomas Fussell <thomas.fussell@gmail.com>2017-03-17 00:33:06 -0400
commitd821b0a28a7223d0b49745c53a3ff032fcb001c8 (patch)
tree12e13d5ff298a4e4b4f946ceb90b49cbfbe2d2c9 /toolsrc/src/commands_edit.cpp
parent4921636f6bc92e041a410870ce564615c85a6cfb (diff)
parent01b1e39c6a006adba7b9cf2af758be679d0b7eb9 (diff)
downloadvcpkg-d821b0a28a7223d0b49745c53a3ff032fcb001c8.tar.gz
vcpkg-d821b0a28a7223d0b49745c53a3ff032fcb001c8.zip
Merge branch 'master' of https://github.com/Microsoft/vcpkg
Diffstat (limited to 'toolsrc/src/commands_edit.cpp')
-rw-r--r--toolsrc/src/commands_edit.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp
index ce0557e09..1252790af 100644
--- a/toolsrc/src/commands_edit.cpp
+++ b/toolsrc/src/commands_edit.cpp
@@ -14,7 +14,7 @@ namespace vcpkg::Commands::Edit
const std::string port_name = args.command_arguments.at(0);
const fs::path portpath = paths.ports / port_name;
- Checks::check_exit(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;
@@ -56,13 +56,19 @@ namespace vcpkg::Commands::Edit
env_EDITOR = p.native();
break;
}
+ auto p_insiders = fs::path(*code_installpath) / "Code - Insiders.exe";
+ if (fs::exists(p_insiders))
+ {
+ env_EDITOR = p_insiders.native();
+ break;
+ }
}
}
}
if (env_EDITOR.empty())
{
- Checks::exit_with_message("Visual Studio Code was not found and the environment variable EDITOR is not set");
+ Checks::exit_with_message(VCPKG_LINE_INFO, "Visual Studio Code was not found and the environment variable EDITOR is not set");
}
std::wstring cmdLine = Strings::wformat(LR"("%s" "%s" "%s" -n)", env_EDITOR, portpath.native(), (portpath / "portfile.cmake").native());