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 ff6bf4e commit db2b64d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
1 change: 0 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ inputs:
version:
description: 'Version of bwenv to set up. Default is latest.'
required: false
default: 'latest'

outputs:
path:
Expand Down
13 changes: 8 additions & 5 deletions dist/main.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -22401,11 +22401,14 @@ async function unzipArchive(archive, destination = __dirname2, deleteAfter = fal
}
async function run() {
try {
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";
const version2 = core.getInput("version", { required: false }) || await (async () => {
const configVersion = await getVersionFromConfigFile();
const availableVersions = await getAvailableVersions();
const matchingVersion = findLatestMatchingVersion(availableVersions, configVersion);
if (!matchingVersion)
throw new Error(`No version matching ${configVersion} found.`);
return matchingVersion;
})();
core.info(`Using Version: ${version2}`);
const releaseURL = await getReleaseURL(version2);
await downloadFile(releaseURL, path.join(__dirname2, "bwenv.zip")).then(
Expand Down
17 changes: 9 additions & 8 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,15 @@ async function unzipArchive(

async function run() {
try {
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';

const version =
core.getInput('version', { required: false }) ||
(await (async () => {
const configVersion = await getVersionFromConfigFile();
const availableVersions = await getAvailableVersions();
const matchingVersion = findLatestMatchingVersion(availableVersions, configVersion);
if (!matchingVersion) throw new Error(`No version matching ${configVersion} found.`);
return matchingVersion;
})());
core.info(`Using Version: ${version}`);

const releaseURL = await getReleaseURL(version);
Expand Down

0 comments on commit db2b64d

Please sign in to comment.