Skip to content

Commit

Permalink
setup-ovr-platform-util@v1.0.2
Browse files Browse the repository at this point in the history
- added 1s delay after self-update to prevent tool call race condition
  • Loading branch information
StephenHodgson committed Sep 11, 2024
1 parent 4f70bd6 commit 2099861
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
12 changes: 11 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33280,10 +33280,20 @@ async function setup_ovrPlatformUtil() {
fs.promises.access(tool);
core.debug(`Found ${tool} in ${toolDirectory}`);
await exec.exec(tool, ['self-update']);
await new Promise(resolve => setTimeout(resolve, 1000));
}
core.debug(`${ovrPlatformUtil} -> ${toolDirectory}`);
core.addPath(toolDirectory);
await exec.exec(ovrPlatformUtil, ['help']);
try {
await exec.exec(ovrPlatformUtil, ['help']);
}
catch (error) {
if (error.code === 'EBUSY') {
core.debug(`Waiting for ${tool} to be released...`);
await new Promise(resolve => setTimeout(resolve, 1000));
await exec.exec(ovrPlatformUtil, ['help']);
}
}
}
function getDownloadUrl() {
if (IS_MAC) {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "setup-ovr-platform-util",
"version": "1.0.1",
"version": "1.0.2",
"description": "A GitHub Action to setup the ovr-platform-util tool command alias.",
"author": "buildalon",
"repository": {
Expand Down
13 changes: 11 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,19 @@ async function setup_ovrPlatformUtil(): Promise<void> {
fs.promises.access(tool);
core.debug(`Found ${tool} in ${toolDirectory}`);
await exec.exec(tool, ['self-update']);
await new Promise(resolve => setTimeout(resolve, 1000));
}
core.debug(`${ovrPlatformUtil} -> ${toolDirectory}`)
core.addPath(toolDirectory);
await exec.exec(ovrPlatformUtil, ['help']);
try {
await exec.exec(ovrPlatformUtil, ['help']);
} catch (error) {
if (error.code === 'EBUSY') {
core.debug(`Waiting for ${tool} to be released...`);
await new Promise(resolve => setTimeout(resolve, 1000));
await exec.exec(ovrPlatformUtil, ['help']);
}
}
}

function getDownloadUrl(): string {
Expand All @@ -64,7 +73,7 @@ function getTempDirectory(): string {
return tempDirectory
}

function getExecutable(directory) {
function getExecutable(directory: string): string {
return path.join(directory, toolPath);
}

Expand Down

0 comments on commit 2099861

Please sign in to comment.