Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHodgson committed Aug 15, 2024
1 parent 68c1892 commit 77bef84
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 18 deletions.
13 changes: 7 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34712,7 +34712,8 @@ async function getLatestHubVersion() {
}
}
const ignoredLines = [
`This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:`,
`This error originated either by throwing inside of an async function without a catch block`,
`Unexpected error attempting to determine if executable file exists`,
`dri3 extension not supported`,
`Failed to connect to the bus:`
];
Expand All @@ -34737,8 +34738,8 @@ async function execUnityHub(args) {
});
break;
case 'linux':
core.info(`[command]xvfb-run --auto-servernum ${hubPath} --headless ${args.join(' ')}`);
await exec.exec('xvfb-run', ['--auto-servernum', hubPath, '--headless', ...args], {
core.info(`[command]unity-hub --headless ${args.join(' ')}`);
await exec.exec('unity-hub', ['--headless', ...args], {
listeners: {
stdline: (data) => {
const line = data.toString();
Expand Down Expand Up @@ -34788,11 +34789,11 @@ async function Unity(version, changeset, architecture, modules) {
await installUnity(version, changeset, architecture, modules);
editorPath = await checkInstalledEditors(version, architecture);
}
await fs.promises.access(editorPath, fs.constants.R_OK);
await fs.promises.access(editorPath, fs.constants.X_OK);
core.info(`Unity Editor Path:\n > "${editorPath}"`);
core.addPath(path.dirname(editorPath));
core.addPath(editorPath);
try {
core.startGroup(`Checking installed modules for Unity ${version} (${changeset})...`);
core.startGroup(`Checking installed modules for Unity ${version}(${changeset})...`);
const [installedModules, additionalModules] = await checkEditorModules(editorPath, version, architecture, modules);
if (installedModules && installedModules.length > 0) {
core.info(`Installed Modules:`);
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions dist/install-unityhub-linux.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#!/bin/bash
set -e
sudo sh -c 'dbus-uuidgen >/etc/machine-id && mkdir -p /var/lib/dbus/ && ln -sf /etc/machine-id /var/lib/dbus/machine-id'
echo "::group::Installing Unity Hub..."
wget -qO - https://hub.unity3d.com/linux/keys/public | gpg --dearmor | sudo tee /usr/share/keyrings/Unity_Technologies_ApS.gpg >/dev/null
sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/Unity_Technologies_ApS.gpg] https://hub.unity3d.com/linux/repos/deb stable main" > /etc/apt/sources.list.d/unityhub.list'
sudo apt update
sudo apt install -y unityhub
sudo apt-get update
sudo apt-get install -y --no-install-recommends unityhub
sudo apt-get clean
sudo sed -i 's/^\(.*DISPLAY=:.*XAUTHORITY=.*\)\( "\$@" \)2>&1$/\1\2/' /usr/bin/xvfb-run
sudo printf '#!/bin/bash\nxvfb-run --auto-servernum /opt/unityhub/unityhub "$@" 2>/dev/null' | sudo tee /usr/bin/unity-hub >/dev/null
sudo chmod 777 /usr/bin/unity-hub
hubPath=$(which unityhub)
if [ -z "$hubPath" ]; then
echo "Failed to install Unity Hub"
Expand Down
9 changes: 7 additions & 2 deletions src/install-unityhub-linux.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#!/bin/bash
set -e
sudo sh -c 'dbus-uuidgen >/etc/machine-id && mkdir -p /var/lib/dbus/ && ln -sf /etc/machine-id /var/lib/dbus/machine-id'
echo "::group::Installing Unity Hub..."
wget -qO - https://hub.unity3d.com/linux/keys/public | gpg --dearmor | sudo tee /usr/share/keyrings/Unity_Technologies_ApS.gpg >/dev/null
sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/Unity_Technologies_ApS.gpg] https://hub.unity3d.com/linux/repos/deb stable main" > /etc/apt/sources.list.d/unityhub.list'
sudo apt update
sudo apt install -y unityhub
sudo apt-get update
sudo apt-get install -y --no-install-recommends unityhub
sudo apt-get clean
sudo sed -i 's/^\(.*DISPLAY=:.*XAUTHORITY=.*\)\( "\$@" \)2>&1$/\1\2/' /usr/bin/xvfb-run
sudo printf '#!/bin/bash\nxvfb-run --auto-servernum /opt/unityhub/unityhub "$@" 2>/dev/null' | sudo tee /usr/bin/unity-hub >/dev/null
sudo chmod 777 /usr/bin/unity-hub
hubPath=$(which unityhub)
if [ -z "$hubPath" ]; then
echo "Failed to install Unity Hub"
Expand Down
15 changes: 8 additions & 7 deletions src/unity-hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ async function getLatestHubVersion(): Promise<semver.SemVer> {
}

const ignoredLines = [
`This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:`,
`This error originated either by throwing inside of an async function without a catch block`,
`Unexpected error attempting to determine if executable file exists`,
`dri3 extension not supported`,
`Failed to connect to the bus:`
];
Expand All @@ -178,9 +179,9 @@ async function execUnityHub(args: string[]): Promise<string> {
ignoreReturnCode: true
});
break;
case 'linux': // xvfb-run --auto-servernum "~/Unity Hub/UnityHub.AppImage" --headless help
core.info(`[command]xvfb-run --auto-servernum ${hubPath} --headless ${args.join(' ')}`);
await exec.exec('xvfb-run', ['--auto-servernum', hubPath, '--headless', ...args], {
case 'linux': // unity-hub --headless help
core.info(`[command]unity-hub --headless ${args.join(' ')}`);
await exec.exec('unity-hub', ['--headless', ...args], {
listeners: {
stdline: (data) => {
const line = data.toString();
Expand Down Expand Up @@ -231,11 +232,11 @@ async function Unity(version: string, changeset: string, architecture: string, m
await installUnity(version, changeset, architecture, modules);
editorPath = await checkInstalledEditors(version, architecture);
}
await fs.promises.access(editorPath, fs.constants.R_OK);
await fs.promises.access(editorPath, fs.constants.X_OK);
core.info(`Unity Editor Path:\n > "${editorPath}"`);
core.addPath(path.dirname(editorPath));
core.addPath(editorPath);
try {
core.startGroup(`Checking installed modules for Unity ${version} (${changeset})...`);
core.startGroup(`Checking installed modules for Unity ${version}(${changeset})...`);
const [installedModules, additionalModules] = await checkEditorModules(editorPath, version, architecture, modules);
if (installedModules && installedModules.length > 0) {
core.info(`Installed Modules:`);
Expand Down

0 comments on commit 77bef84

Please sign in to comment.