Skip to content

Commit

Permalink
feat: more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
nyarthan committed Mar 13, 2024
1 parent c87476d commit bd446e9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
11 changes: 5 additions & 6 deletions dist/main.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -22392,12 +22392,11 @@ async function unzipArchive(archive, destination = __dirname2, deleteAfter = fal
}
async function run() {
try {
const version2 = core.getInput("version", { required: false }) || (await (async () => {
const configVersion = await getVersionFromConfigFile();
const availableVersions = await getAvailableVersions();
const matchingVersion = findLatestMatchingVersion(availableVersions, configVersion);
return matchingVersion;
})() ?? "latest");
const inputVersion = core.getInput("version", { required: false });
const configVersion = await getVersionFromConfigFile();
const availableVersions = await getAvailableVersions();
const matchingVersion = findLatestMatchingVersion(availableVersions, configVersion);
const version2 = inputVersion || matchingVersion || "latest";
core.info(`Using Version: ${version2}`);
const releaseURL = await getReleaseURL(version2);
await downloadFile(releaseURL, path.join(__dirname2, "bwenv.zip")).then(
Expand Down
17 changes: 8 additions & 9 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,13 @@ async function unzipArchive(

async function run() {
try {
const version =
core.getInput('version', { required: false }) ||
((await (async () => {
const configVersion = await getVersionFromConfigFile();
const availableVersions = await getAvailableVersions();
const matchingVersion = findLatestMatchingVersion(availableVersions, configVersion);
return matchingVersion;
})()) ??
'latest');
const inputVersion = core.getInput('version', { required: false });

const configVersion = await getVersionFromConfigFile();
const availableVersions = await getAvailableVersions();
const matchingVersion = findLatestMatchingVersion(availableVersions, configVersion);

const version = inputVersion || matchingVersion || 'latest';

core.info(`Using Version: ${version}`);

Expand All @@ -198,6 +196,7 @@ async function run() {

core.addPath(toolDir);
} catch (error) {
// @ts-expect-error
core.setFailed(error.message);
}
}
Expand Down

0 comments on commit bd446e9

Please sign in to comment.