@@ -14,6 +14,7 @@ if ([String]::IsNullOrEmpty($projectPath)) {
1414    }
1515
1616    $projectPath  =  (Get-Item  $versionFilePath ).Directory.Parent.FullName
17+     $projectPath  =  $projectPath  -replace  ' \\' , ' /' 
1718    Write-Host  " Unity project path: `" $projectPath `" " 
1819    " UNITY_PROJECT_PATH=$projectPath " >>  $env: GITHUB_ENV 
1920}
@@ -34,16 +35,15 @@ if (-not ([String]::IsNullOrEmpty($unityVersion))) {
3435}
3536
3637if  ($IsWindows ) {
37-     $hubPath  =  " C:\ Program Files\ Unity Hub\ Unity Hub.exe" 
38-     $editorRootPath  =  " C:\ Program Files\ Unity\ Hub\ Editor\ " 
39-     $editorFileEx  =  " \ Editor\ Unity.exe" 
38+     $hubPath  =  " C:/ Program Files/ Unity Hub/ Unity Hub.exe" 
39+     $editorRootPath  =  " C:/ Program Files/ Unity/ Hub/ Editor/ " 
40+     $editorFileEx  =  " / Editor/ Unity.exe" 
4041
4142    if  ([string ]::IsNullOrEmpty($modulesList )) {
4243        $modules  =  @ (' windows-il2cpp' ,  ' universal-windows-platform' ,  ' android' ,  ' ios' 
4344    }
4445
45-     # "Unity Hub.exe" -- --headless help
46-     # . 'C:\Program Files\Unity Hub\Unity Hub.exe' -- --headless help
46+     # . 'C:/Program Files/Unity Hub/Unity Hub.exe' -- --headless help
4747    function  Invoke-UnityHub  {
4848        $argList  =  (@ (' --' , ' --headless' +  $args.Split  ("  " 
4949        $p  =  Start-Process  - NoNewWindow - PassThru - Wait - FilePath " $hubPath " - ArgumentList $argList 
@@ -58,7 +58,6 @@ if ($IsWindows) {
5858        $modules  =  @ (' mac-il2cpp' ,  ' ios' ,  ' android' 
5959    }
6060
61-     #  /Applications/Unity\ Hub.app/Contents/MacOS/Unity\ Hub -- --headless help
6261    # . "/Applications/Unity Hub.app/Contents/MacOS/Unity Hub" -- --headless help
6362    function  Invoke-UnityHub  {
6463        $argList  =  (@ (' --' , ' --headless' +  $args.Split  ("  " 
@@ -74,7 +73,6 @@ if ($IsWindows) {
7473        $modules  =  @ (' linux-il2cpp' ,  ' android' ,  ' ios' 
7574    }
7675
77-     #  /UnityHub.AppImage --headless help
7876    #  xvfb-run --auto-servernum "$HOME/Unity Hub/UnityHub.AppImage" --headless help
7977    function  Invoke-UnityHub  {
8078        $argsList  =  $args.Split  ("  " 
@@ -244,7 +242,7 @@ if (-not (Test-Path -Path $editorPath)) {
244242    exit  1 
245243}
246244
247- $modulesPath  =  ' {0}{1}{2} modules.json' -f  $editorRootPath , $UnityVersion , [ IO.Path ]::DirectorySeparatorChar 
245+ $modulesPath  =  ' {0}{1}/ modules.json' -f  $editorRootPath , $UnityVersion 
248246
249247if  (-not  (Test-Path  - Path $modulesPath )) {
250248    $editorPath  =  " {0}{1}" -f  $editorRootPath , $unityVersion 
@@ -271,6 +269,7 @@ $envEditorPath = $env:UNITY_EDITOR_PATH
271269
272270if  ([String ]::IsNullOrEmpty($envEditorPath )) {
273271    Write-Host  " " 
272+     $editorPath  =  $editorPath  -replace  ' \\' , ' /' 
274273    " UNITY_EDITOR_PATH=$editorPath " >>  $env: GITHUB_ENV 
275274    Write-Host  " UnityEditor path set to: $editorPath " 
276275}
0 commit comments