Skip to content
This repository was archived by the owner on Aug 11, 2024. It is now read-only.

Commit 9861a4f

Browse files
* update editor root path to be forward slashes only
1 parent 5e88ddf commit 9861a4f

File tree

4 files changed

+17
-19
lines changed

4 files changed

+17
-19
lines changed

dist/unity-install.ps1

+7-8
Original file line numberDiff line numberDiff line change
@@ -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

3637
if ($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

249247
if (-not (Test-Path -Path $modulesPath)) {
250248
$editorPath = "{0}{1}" -f $editorRootPath,$unityVersion
@@ -271,6 +269,7 @@ $envEditorPath = $env:UNITY_EDITOR_PATH
271269

272270
if ([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
}

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "unity-setup",
3-
"version": "7.4.1",
3+
"version": "7.4.2",
44
"description": "An atomic GitHub action to download and install the Unity Editor for runners.",
55
"main": "src/index.js",
66
"scripts": {

src/unity-install.ps1

+7-8
Original file line numberDiff line numberDiff line change
@@ -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

3637
if ($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

249247
if (-not (Test-Path -Path $modulesPath)) {
250248
$editorPath = "{0}{1}" -f $editorRootPath,$unityVersion
@@ -271,6 +269,7 @@ $envEditorPath = $env:UNITY_EDITOR_PATH
271269

272270
if ([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

Comments
 (0)