Skip to content

Commit 8b6bcf1

Browse files
committed
Refine for snap
1 parent 23a073d commit 8b6bcf1

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Packages/com.unity.ide.visualstudio/Editor/VisualStudioCodeInstallation.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,16 @@ private static IEnumerable<string> GetXdgCandidates()
189189

190190
try
191191
{
192-
var desktopFile = IOPath.Combine(dir, "applications/code.desktop");
193-
if (!File.Exists(desktopFile))
194-
continue;
192+
foreach (var desktopFile in new[] {"code.desktop", "code_code.desktop"})
193+
{
194+
var desktopPath = IOPath.Combine(dir, "applications", desktopFile);
195+
if (!File.Exists(desktopPath))
196+
continue;
195197

196-
var content = File.ReadAllText(desktopFile);
197-
match = DesktopFileExecEntry.Match(content);
198+
var content = File.ReadAllText(desktopPath);
199+
match = DesktopFileExecEntry.Match(content);
200+
break;
201+
}
198202
}
199203
catch
200204
{

0 commit comments

Comments
 (0)