Skip to content

Commit aaaaaf8

Browse files
setup-ovr-platform-util@v1.0.1 (#2)
- convert to TypeScript
1 parent 5ef5f02 commit aaaaaf8

File tree

9 files changed

+354
-56
lines changed

9 files changed

+354
-56
lines changed

.github/workflows/validate.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ jobs:
2121
matrix:
2222
os: [ macos-latest, windows-latest ]
2323
steps:
24-
- name: checkout self
25-
uses: actions/checkout@v4
24+
- uses: actions/checkout@v4
2625
- name: buildalon/setup-ovr-platform-util
2726
uses: ./
2827
- run: 'ovr-platform-util version'

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Buildalon: Automate Unity
3+
Copyright (c) 2024 Virtual Maker Corporation
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Discord](https://img.shields.io/discord/939721153688264824.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/VM9cWJ9rjH) [![validate](https://github.com/buildalon/setup-ovr-platform-util/actions/workflows/validate.yml/badge.svg?branch=main&event=push)](https://github.com/buildalon/setup-ovr-platform-util/actions/workflows/validate.yml)
44

5-
A GitHub Action to setup the [ovr-platform-util](https://developer.oculus.com/resources/publish-reference-platform-command-line-utility) tool command alias.
5+
A GitHub Action to setup the [`ovr-platform-utility`](https://developer.oculus.com/resources/publish-reference-platform-command-line-utility) tool command alias.
66

77
## How to use
88

dist/index.js

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -33231,32 +33231,33 @@ module.exports = parseParams
3323133231
/******/
3323233232
/************************************************************************/
3323333233
var __webpack_exports__ = {};
33234-
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
33234+
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
3323533235
(() => {
33236-
const semver = __nccwpck_require__(1383);
33237-
const path = __nccwpck_require__(1017);
33238-
const core = __nccwpck_require__(2186);
33236+
"use strict";
33237+
var exports = __webpack_exports__;
33238+
33239+
Object.defineProperty(exports, "__esModule", ({ value: true }));
3323933240
const tc = __nccwpck_require__(7784);
33241+
const core = __nccwpck_require__(2186);
3324033242
const exec = __nccwpck_require__(1514);
33241-
const fs = (__nccwpck_require__(7147).promises);
33242-
33243+
const semver = __nccwpck_require__(1383);
33244+
const path = __nccwpck_require__(1017);
33245+
const fs = __nccwpck_require__(7147);
3324333246
const ovrPlatformUtil = 'ovr-platform-util';
33244-
const IS_WINDOWS = process.platform === 'win32'
33245-
const IS_MAC = process.platform === 'darwin'
33247+
const IS_WINDOWS = process.platform === 'win32';
33248+
const IS_MAC = process.platform === 'darwin';
3324633249
const toolExtension = IS_WINDOWS ? '.exe' : '';
3324733250
const toolPath = `${ovrPlatformUtil}${toolExtension}`;
33248-
3324933251
const main = async () => {
3325033252
try {
3325133253
core.info(`Setting up ${ovrPlatformUtil}...`);
3325233254
await setup_ovrPlatformUtil();
33253-
} catch (error) {
33255+
}
33256+
catch (error) {
3325433257
core.setFailed(error);
3325533258
}
33256-
}
33257-
33259+
};
3325833260
main();
33259-
3326033261
async function setup_ovrPlatformUtil() {
3326133262
let toolDirectory = tc.find(ovrPlatformUtil, '*');
3326233263
let tool = undefined;
@@ -33273,41 +33274,39 @@ async function setup_ovrPlatformUtil() {
3327333274
core.debug(`Setting tool cache: ${archivePath} | ${toolPath} | ${ovrPlatformUtil} | ${downloadVersion}`);
3327433275
toolDirectory = await tc.cacheFile(archivePath, toolPath, ovrPlatformUtil, downloadVersion);
3327533276
tool = getExecutable(toolDirectory);
33276-
} else {
33277+
}
33278+
else {
3327733279
tool = getExecutable(toolDirectory);
33278-
fs.access(tool);
33280+
fs.promises.access(tool);
3327933281
core.debug(`Found ${tool} in ${toolDirectory}`);
33280-
await exec.exec(tool, 'self-update');
33282+
await exec.exec(tool, ['self-update']);
3328133283
}
33282-
core.debug(`${ovrPlatformUtil} -> ${toolDirectory}`)
33284+
core.debug(`${ovrPlatformUtil} -> ${toolDirectory}`);
3328333285
core.addPath(toolDirectory);
33284-
await exec.exec(ovrPlatformUtil, 'help');
33286+
await exec.exec(ovrPlatformUtil, ['help']);
3328533287
}
33286-
3328733288
function getDownloadUrl() {
3328833289
if (IS_MAC) {
3328933290
return 'https://www.oculus.com/download_app/?id=1462426033810370';
33290-
} else if (IS_WINDOWS) {
33291+
}
33292+
else if (IS_WINDOWS) {
3329133293
return 'https://www.oculus.com/download_app/?id=1076686279105243';
33292-
} else {
33294+
}
33295+
else {
3329333296
throw Error(`${ovrPlatformUtil} not available for ${process.platform}`);
3329433297
}
3329533298
}
33296-
3329733299
function getTempDirectory() {
33298-
const tempDirectory = process.env['RUNNER_TEMP'] || ''
33299-
return tempDirectory
33300+
const tempDirectory = process.env['RUNNER_TEMP'] || '';
33301+
return tempDirectory;
3330033302
}
33301-
3330233303
function getExecutable(directory) {
3330333304
return path.join(directory, toolPath);
3330433305
}
33305-
3330633306
async function getVersion(tool) {
3330733307
const semVerRegEx = new RegExp(/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)?/);
3330833308
let output = '';
33309-
33310-
await exec.exec(tool, 'version', {
33309+
await exec.exec(tool, ['version'], {
3331133310
listeners: {
3331233311
stdout: (data) => {
3331333312
output += data.toString();
@@ -33324,7 +33323,7 @@ async function getVersion(tool) {
3332433323
if (!version) {
3332533324
throw Error("Failed to find a valid version");
3332633325
}
33327-
return version
33326+
return version;
3332833327
}
3332933328

3333033329
})();

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.

0 commit comments

Comments
 (0)