Skip to content

Commit 2f3d639

Browse files
authored
Merge pull request #182 from jwittner/fix/editorSearching
Look for expected unity.exe instead of searching recursively
2 parents 3b5be1b + 2bbbff7 commit 2f3d639

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

UnitySetup/UnitySetup.psm1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,11 @@ function Get-UnityEditor {
264264
foreach ($p in $Path) {
265265
switch ($currentOS) {
266266
([OperatingSystem]::Windows) {
267-
$editor = Get-ChildItem "$p" -Filter 'Unity.exe' -Recurse |
268-
Select-Object -First 1 -ExpandProperty FullName
269-
270-
Write-Output $editor
267+
$editor = Join-Path "$p" 'Editor\Unity.exe'
268+
269+
if (Test-Path $editor) {
270+
Write-Output (Resolve-Path $editor).Path
271+
}
271272
}
272273
([OperatingSystem]::Linux) {
273274
throw "Get-UnityEditor has not been implemented on the Linux platform. Contributions welcomed!";

0 commit comments

Comments
 (0)