Skip to content

Commit 43dd0d3

Browse files
setup-ovr-platform-util@v1.1.6 (#20)
- Add Linux platform support
1 parent 226103f commit 43dd0d3

File tree

7 files changed

+30
-15
lines changed

7 files changed

+30
-15
lines changed

.github/workflows/validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
os: [ macos-latest, windows-latest, macos, windows ]
22+
os: [ubuntu-latest, macos-latest, windows-latest, macos, windows]
2323
steps:
2424
- uses: actions/checkout@v4
2525
- name: RageAgainstThePixel/setup-ovr-platform-util

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ${{ matrix.os }}
1111
strategy:
1212
matrix:
13-
os: [ macos-latest, windows-latest, macos, windows ]
13+
os: [ubuntu-latest, macos-latest, windows-latest]
1414
steps:
1515
# download and setup ovr platform util
1616
- uses: RageAgainstThePixel/setup-ovr-platform-util@v1

dist/index.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33961,6 +33961,7 @@ const fs = __nccwpck_require__(7147);
3396133961
const ovrPlatformUtil = 'ovr-platform-util';
3396233962
const IS_WINDOWS = process.platform === 'win32';
3396333963
const IS_MAC = process.platform === 'darwin';
33964+
const IS_LINUX = process.platform === 'linux';
3396433965
const toolExtension = IS_WINDOWS ? '.exe' : '';
3396533966
const toolPath = `${ovrPlatformUtil}${toolExtension}`;
3396633967
const main = async () => {
@@ -33974,15 +33975,21 @@ const main = async () => {
3397433975
};
3397533976
main();
3397633977
async function setup_ovrPlatformUtil() {
33977-
let toolDirectory = tc.find(ovrPlatformUtil, '*');
33978+
let toolDirectory = undefined;
33979+
try {
33980+
toolDirectory = tc.find(ovrPlatformUtil, '*');
33981+
}
33982+
catch (error) {
33983+
core.debug(`Failed to find ${ovrPlatformUtil} in cache: ${error.message}`);
33984+
}
3397833985
let tool = undefined;
3397933986
if (!toolDirectory) {
3398033987
const url = getDownloadUrl();
3398133988
const archiveDownloadPath = path.resolve(getTempDirectory(), toolPath);
3398233989
core.debug(`Attempting to download ${ovrPlatformUtil} from ${url} to ${archiveDownloadPath}`);
3398333990
const archivePath = await tc.downloadTool(url, archiveDownloadPath);
3398433991
core.debug(`Successfully downloaded ${ovrPlatformUtil} to ${archivePath}`);
33985-
if (IS_MAC) {
33992+
if (IS_MAC || IS_LINUX) {
3398633993
await exec.exec(`chmod +x ${archivePath}`);
3398733994
}
3398833995
const downloadVersion = await getVersion(archivePath);
@@ -34024,13 +34031,15 @@ function getDownloadUrl() {
3402434031
else if (IS_WINDOWS) {
3402534032
return 'https://www.oculus.com/download_app/?id=1076686279105243';
3402634033
}
34034+
else if (IS_LINUX) {
34035+
return 'https://www.oculus.com/download_app/?id=5159709737372459';
34036+
}
3402734037
else {
3402834038
throw Error(`${ovrPlatformUtil} not available for ${process.platform}`);
3402934039
}
3403034040
}
3403134041
function getTempDirectory() {
34032-
const tempDirectory = process.env['RUNNER_TEMP'] || '';
34033-
return tempDirectory;
34042+
return process.env['RUNNER_TEMP'] || '';
3403434043
}
3403534044
async function getExecutable(directory) {
3403634045
const tool = path.join(directory, toolPath);

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "setup-ovr-platform-util",
3-
"version": "1.1.5",
3+
"version": "1.1.6",
44
"description": "A GitHub Action to setup the ovr-platform-util tool command alias.",
55
"author": "RageAgainstThePixel",
66
"repository": {

src/index.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import fs = require('fs');
88
const ovrPlatformUtil = 'ovr-platform-util';
99
const IS_WINDOWS = process.platform === 'win32'
1010
const IS_MAC = process.platform === 'darwin'
11+
const IS_LINUX = process.platform === 'linux'
1112
const toolExtension = IS_WINDOWS ? '.exe' : '';
1213
const toolPath = `${ovrPlatformUtil}${toolExtension}`;
1314

@@ -23,15 +24,20 @@ const main = async () => {
2324
main();
2425

2526
async function setup_ovrPlatformUtil(): Promise<void> {
26-
let toolDirectory = tc.find(ovrPlatformUtil, '*');
27+
let toolDirectory = undefined;
28+
try {
29+
toolDirectory = tc.find(ovrPlatformUtil, '*');
30+
} catch (error) {
31+
core.debug(`Failed to find ${ovrPlatformUtil} in cache: ${error.message}`);
32+
}
2733
let tool = undefined;
2834
if (!toolDirectory) {
2935
const url = getDownloadUrl();
3036
const archiveDownloadPath = path.resolve(getTempDirectory(), toolPath);
3137
core.debug(`Attempting to download ${ovrPlatformUtil} from ${url} to ${archiveDownloadPath}`);
3238
const archivePath = await tc.downloadTool(url, archiveDownloadPath);
3339
core.debug(`Successfully downloaded ${ovrPlatformUtil} to ${archivePath}`);
34-
if (IS_MAC) {
40+
if (IS_MAC || IS_LINUX) {
3541
await exec.exec(`chmod +x ${archivePath}`);
3642
}
3743
const downloadVersion = await getVersion(archivePath);
@@ -70,14 +76,15 @@ function getDownloadUrl(): string {
7076
return 'https://www.oculus.com/download_app/?id=1462426033810370';
7177
} else if (IS_WINDOWS) {
7278
return 'https://www.oculus.com/download_app/?id=1076686279105243';
79+
} else if (IS_LINUX) {
80+
return 'https://www.oculus.com/download_app/?id=5159709737372459';
7381
} else {
7482
throw Error(`${ovrPlatformUtil} not available for ${process.platform}`);
7583
}
7684
}
7785

7886
function getTempDirectory(): string {
79-
const tempDirectory = process.env['RUNNER_TEMP'] || ''
80-
return tempDirectory
87+
return process.env['RUNNER_TEMP'] || ''
8188
}
8289

8390
async function getExecutable(directory: string): Promise<string> {
@@ -90,7 +97,6 @@ async function getExecutable(directory: string): Promise<string> {
9097
async function getVersion(tool: string): Promise<string> {
9198
const semVerRegEx = new RegExp(/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)?/);
9299
let output = '';
93-
94100
await exec.exec(tool, ['version'], {
95101
listeners: {
96102
stdout: (data) => {

0 commit comments

Comments
 (0)