Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- fix cache lookup
  • Loading branch information
StephenHodgson authored Jul 28, 2024
1 parent ac362d4 commit 7a82845
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
10 changes: 8 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30722,7 +30722,13 @@ async function setup_steamcmd() {
}

async function findOrDownload() {
let toolDirectory = tc.find(steamcmd, '*');
const allVersions = tc.findAllVersions(steamcmd);
core.debug(`Found versions: ${allVersions}`);
let toolDirectory = undefined;
if (allVersions && allVersions.length > 0) {
const latest = allVersions.sort().pop();
toolDirectory = tc.find(steamcmd, latest);
}
let tool = undefined;
if (!toolDirectory) {
const [url, archiveName] = getDownloadUrl();
Expand Down Expand Up @@ -30800,7 +30806,7 @@ async function getVersion(tool) {
if (!match) {
throw new Error('Failed to get version');
}
const version = match.groups.version
const version = `${match.groups.version}.0.0`;
if (!version) {
throw new Error('Failed to parse version');
}
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-steamcmd",
"version": "1.1.1",
"version": "1.1.2",
"description": "Sets up steamcmd for Github Action Runners",
"author": "RageAgainstThePixel",
"repository": {
Expand Down
10 changes: 8 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ async function setup_steamcmd() {
}

async function findOrDownload() {
let toolDirectory = tc.find(steamcmd, '*');
const allVersions = tc.findAllVersions(steamcmd);
core.debug(`Found versions: ${allVersions}`);
let toolDirectory = undefined;
if (allVersions && allVersions.length > 0) {
const latest = allVersions.sort().pop();
toolDirectory = tc.find(steamcmd, latest);
}
let tool = undefined;
if (!toolDirectory) {
const [url, archiveName] = getDownloadUrl();
Expand Down Expand Up @@ -114,7 +120,7 @@ async function getVersion(tool) {
if (!match) {
throw new Error('Failed to get version');
}
const version = match.groups.version
const version = `${match.groups.version}.0.0`;
if (!version) {
throw new Error('Failed to parse version');
}
Expand Down

0 comments on commit 7a82845

Please sign in to comment.