Skip to content

Commit

Permalink
Fix VS Code path to handle renamed .app files on macOS (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTripleV authored Feb 14, 2025
1 parent 08dfef8 commit b1e49c6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion WPILibInstaller-Avalonia/ViewModels/InstallPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,12 @@ private async Task RunVsCodeExtensionsSetup()
break;
case Platform.MacArm64:
case Platform.Mac64:
codeExe = Path.Combine(configurationProvider.InstallDirectory, "vscode", "Visual Studio Code.app", "Contents", "Resources", "app", "bin", "code");
var appDirectories = Directory.GetDirectories(Path.Combine(configurationProvider.InstallDirectory, "vscode"), "*.app");
if (appDirectories.Length != 1)
{
throw new InvalidOperationException("Expected exactly one .app directory in the vscode folder.");
}
codeExe = Path.Combine(appDirectories[0], "Contents", "Resources", "app", "bin", "code");
break;
case Platform.Linux64:
codeExe = Path.Combine(configurationProvider.InstallDirectory, "vscode", "VSCode-linux-x64", "bin", "code");
Expand Down

0 comments on commit b1e49c6

Please # to comment.