This repository was archived by the owner on Aug 11, 2024. It is now read-only.
File tree 4 files changed +51
-13
lines changed
4 files changed +51
-13
lines changed Original file line number Diff line number Diff line change @@ -109,16 +109,35 @@ if ( -not (Test-Path -Path "$hubPath") ) {
109
109
exit 1
110
110
}
111
111
} elseif ($IsMacOS ) {
112
- Write-Host " ::group::Installing Unity Hub on masOS ..."
112
+ Write-Host " ::group::Installing Unity Hub on macOS ..."
113
113
$package = " UnityHubSetup.dmg"
114
114
$downloadPath = " $outPath /$package "
115
115
$wc.DownloadFile (" $baseUrl /$package " , $downloadPath )
116
116
117
+ if (! (Test-Path $downloadPath )) {
118
+ Write-Error " Failed to download $package "
119
+ exit 1
120
+ }
121
+
117
122
$dmgVolume = (sudo hdiutil attach $downloadPath - nobrowse) | Select-String - Pattern ' \/Volumes\/.*' - AllMatches | ForEach-Object { $_.Matches } | ForEach-Object { $_.Value } | select-object - first 1
118
- Write-Host $dmgVolume
119
- $dmgAppPath = (find " $DMGVolume " - name " *.app" - depth 1 )
120
- Write-Host $dmgAppPath
121
- sudo cp - rf " `" $dmgAppPath `" " " /Applications"
123
+ Write-Host " DMG Volume: $dmgVolume "
124
+ Start-Sleep - Seconds 1
125
+
126
+ if ([string ]::IsNullOrEmpty($dmgVolume )) {
127
+ Write-Error " Failed to mount DMG volume"
128
+ exit 1
129
+ }
130
+
131
+ $dmgAppPath = (sudo find " $dmgVolume " - name " *.app" - print | head - n 1 )
132
+ Write-Host " DMG App Path: $dmgAppPath "
133
+ Start-Sleep - Seconds 1
134
+
135
+ if (! (Test-Path $dmgAppPath )) {
136
+ Write-Error " Unity Hub app not found at expected path: $dmgAppPath "
137
+ exit 1
138
+ }
139
+
140
+ sudo cp - rf $dmgAppPath " /Applications"
122
141
hdiutil unmount $dmgVolume
123
142
sudo mkdir - p " /Library/Application Support/Unity"
124
143
sudo chmod 775 " /Library/Application Support/Unity"
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " unity-setup" ,
3
- "version" : " 7.4.2 " ,
3
+ "version" : " 7.4.3 " ,
4
4
"description" : " An atomic GitHub action to download and install the Unity Editor for runners." ,
5
5
"main" : " src/index.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -109,16 +109,35 @@ if ( -not (Test-Path -Path "$hubPath") ) {
109
109
exit 1
110
110
}
111
111
} elseif ($IsMacOS ) {
112
- Write-Host " ::group::Installing Unity Hub on masOS ..."
112
+ Write-Host " ::group::Installing Unity Hub on macOS ..."
113
113
$package = " UnityHubSetup.dmg"
114
114
$downloadPath = " $outPath /$package "
115
115
$wc.DownloadFile (" $baseUrl /$package " , $downloadPath )
116
116
117
+ if (! (Test-Path $downloadPath )) {
118
+ Write-Error " Failed to download $package "
119
+ exit 1
120
+ }
121
+
117
122
$dmgVolume = (sudo hdiutil attach $downloadPath - nobrowse) | Select-String - Pattern ' \/Volumes\/.*' - AllMatches | ForEach-Object { $_.Matches } | ForEach-Object { $_.Value } | select-object - first 1
118
- Write-Host $dmgVolume
119
- $dmgAppPath = (find " $DMGVolume " - name " *.app" - depth 1 )
120
- Write-Host $dmgAppPath
121
- sudo cp - rf " `" $dmgAppPath `" " " /Applications"
123
+ Write-Host " DMG Volume: $dmgVolume "
124
+ Start-Sleep - Seconds 1
125
+
126
+ if ([string ]::IsNullOrEmpty($dmgVolume )) {
127
+ Write-Error " Failed to mount DMG volume"
128
+ exit 1
129
+ }
130
+
131
+ $dmgAppPath = (sudo find " $dmgVolume " - name " *.app" - print | head - n 1 )
132
+ Write-Host " DMG App Path: $dmgAppPath "
133
+ Start-Sleep - Seconds 1
134
+
135
+ if (! (Test-Path $dmgAppPath )) {
136
+ Write-Error " Unity Hub app not found at expected path: $dmgAppPath "
137
+ exit 1
138
+ }
139
+
140
+ sudo cp - rf $dmgAppPath " /Applications"
122
141
hdiutil unmount $dmgVolume
123
142
sudo mkdir - p " /Library/Application Support/Unity"
124
143
sudo chmod 775 " /Library/Application Support/Unity"
You can’t perform that action at this time.
0 commit comments