aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src
diff options
context:
space:
mode:
authorAgustín Rodríguez <me@agurodriguez.net>2018-11-06 22:48:34 -0300
committerRobert Schumacher <roschuma@microsoft.com>2018-11-06 17:48:34 -0800
commitf194e98593ac5638a15cb4b9675f52e63d2ffaf3 (patch)
tree32a63a37d67cba0aeaccf5f5d6b593323b7be9d4 /toolsrc/src
parenteaf30a4221de8fe49bb12199cd8c1c9fe4864add (diff)
downloadvcpkg-f194e98593ac5638a15cb4b9675f52e63d2ffaf3.tar.gz
vcpkg-f194e98593ac5638a15cb4b9675f52e63d2ffaf3.zip
added vscode autodetection in macOS (#4589)
Diffstat (limited to 'toolsrc/src')
-rw-r--r--toolsrc/src/vcpkg/commands.edit.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/toolsrc/src/vcpkg/commands.edit.cpp b/toolsrc/src/vcpkg/commands.edit.cpp
index b9d9d8c1a..044ae1c47 100644
--- a/toolsrc/src/vcpkg/commands.edit.cpp
+++ b/toolsrc/src/vcpkg/commands.edit.cpp
@@ -107,9 +107,6 @@ namespace vcpkg::Commands::Edit
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths)
{
- static const fs::path VS_CODE_INSIDERS = fs::path{"Microsoft VS Code Insiders"} / "Code - Insiders.exe";
- static const fs::path VS_CODE = fs::path{"Microsoft VS Code"} / "Code.exe";
-
auto& fs = paths.get_filesystem();
const ParsedArguments options = args.parse_arguments(COMMAND_STRUCTURE);
@@ -129,6 +126,10 @@ namespace vcpkg::Commands::Edit
candidate_paths.emplace_back(*editor_path);
}
+#ifdef _WIN32
+ static const fs::path VS_CODE_INSIDERS = fs::path{"Microsoft VS Code Insiders"} / "Code - Insiders.exe";
+ static const fs::path VS_CODE = fs::path{"Microsoft VS Code"} / "Code.exe";
+
const auto& program_files = System::get_program_files_platform_bitness();
if (const fs::path* pf = program_files.get())
{
@@ -153,6 +154,10 @@ namespace vcpkg::Commands::Edit
const std::vector<fs::path> from_registry = find_from_registry();
candidate_paths.insert(candidate_paths.end(), from_registry.cbegin(), from_registry.cend());
+#elif defined(__APPLE__)
+ candidate_paths.push_back(fs::path{"/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/bin/code"});
+ candidate_paths.push_back(fs::path{"/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code"});
+#endif
const auto it = Util::find_if(candidate_paths, [&](const fs::path& p) { return fs.exists(p); });
if (it == candidate_paths.cend())