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

Commit

Permalink
revert and add some logging
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHodgson committed Jul 17, 2024
1 parent b1fbac5 commit d68c56e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 14 deletions.
12 changes: 8 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28088,8 +28088,8 @@ const main = async () => {
core.debug(`buildTargets: ${buildTargets}`);

if (!buildTargets) {
modules = core.getInput('modules');
var modules = modules.replace(/,/g, '').split(/\s+/);
modules = core.getInput('modules');
var modules = modules.replace(/,/g, '').split(/\s+/);
} else {
const osType = os.type();
var moduleMap = undefined;
Expand Down Expand Up @@ -28171,7 +28171,11 @@ const main = async () => {
var install = __nccwpck_require__.ab + "unity-install.ps1";
var exitCode = 0;

exitCode = await exec.exec(`"${pwsh}" -Command`, `${install} ${args}`);
try {
exitCode = await exec.exec(`"${pwsh}" -Command`, `${install} ${args}`);
} catch (error) {
core.error(error);
}

if (exitCode != 0) {
throw Error(`Unity Installation Failed! exitCode: ${exitCode}`)
Expand Down Expand Up @@ -28199,7 +28203,7 @@ const findFile = async (dir, filePath) => {
}

if (matchedFiles.length == 0) {
for(const subDir of directories) {
for (const subDir of directories) {
const nestedMatches = await findFile(subDir, filePath);

for (const nestedMatch of nestedMatches) {
Expand Down
8 changes: 5 additions & 3 deletions dist/unity-install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ if ( -not (Test-Path -Path "$hubPath") ) {
exit 1
}

Write-Host "Unity Hub installed at $hubPath"

sudo chmod -R 777 $hubPath
sudo mkdir -p "/Library/Application Support/Unity"
sudo chmod -R 777 "/Library/Application Support/Unity"
Expand Down Expand Up @@ -311,9 +313,9 @@ foreach ($module in (Get-Content -Raw -Path $modulesPath | ConvertFrom-Json -AsH
$envEditorPath = $env:UNITY_EDITOR_PATH

# if mac or linux update permissons for editor installation
if ($IsMacOS -or $IsLinux) {
sudo chmod -R 777 $editorRootPath
}
# if ($IsMacOS -or $IsLinux) {
# sudo chmod -R 777 $editorRootPath
# }

if ([String]::IsNullOrEmpty($envEditorPath)) {
Write-Host ""
Expand Down
12 changes: 8 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ const main = async () => {
core.debug(`buildTargets: ${buildTargets}`);

if (!buildTargets) {
modules = core.getInput('modules');
var modules = modules.replace(/,/g, '').split(/\s+/);
modules = core.getInput('modules');
var modules = modules.replace(/,/g, '').split(/\s+/);
} else {
const osType = os.type();
var moduleMap = undefined;
Expand Down Expand Up @@ -110,7 +110,11 @@ const main = async () => {
var install = path.resolve(__dirname, 'unity-install.ps1');
var exitCode = 0;

exitCode = await exec.exec(`"${pwsh}" -Command`, `${install} ${args}`);
try {
exitCode = await exec.exec(`"${pwsh}" -Command`, `${install} ${args}`);
} catch (error) {
core.error(error);
}

if (exitCode != 0) {
throw Error(`Unity Installation Failed! exitCode: ${exitCode}`)
Expand Down Expand Up @@ -138,7 +142,7 @@ const findFile = async (dir, filePath) => {
}

if (matchedFiles.length == 0) {
for(const subDir of directories) {
for (const subDir of directories) {
const nestedMatches = await findFile(subDir, filePath);

for (const nestedMatch of nestedMatches) {
Expand Down
8 changes: 5 additions & 3 deletions src/unity-install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ if ( -not (Test-Path -Path "$hubPath") ) {
exit 1
}

Write-Host "Unity Hub installed at $hubPath"

sudo chmod -R 777 $hubPath
sudo mkdir -p "/Library/Application Support/Unity"
sudo chmod -R 777 "/Library/Application Support/Unity"
Expand Down Expand Up @@ -311,9 +313,9 @@ foreach ($module in (Get-Content -Raw -Path $modulesPath | ConvertFrom-Json -AsH
$envEditorPath = $env:UNITY_EDITOR_PATH

# if mac or linux update permissons for editor installation
if ($IsMacOS -or $IsLinux) {
sudo chmod -R 777 $editorRootPath
}
# if ($IsMacOS -or $IsLinux) {
# sudo chmod -R 777 $editorRootPath
# }

if ([String]::IsNullOrEmpty($envEditorPath)) {
Write-Host ""
Expand Down

0 comments on commit d68c56e

Please sign in to comment.