Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHodgson committed Dec 4, 2024
1 parent d8f640a commit 7073b9c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
13 changes: 7 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28800,7 +28800,7 @@ const toolExtension = IS_WINDOWS ? '.exe' : '';
const toolPath = `${butler}${toolExtension}`;
async function Run() {
const toolDirectory = await findOrDownload();
core.debug(`${BUTLER_DIR} -> ${toolDirectory}`);
core.info(`${BUTLER_DIR} -> ${toolDirectory}`);
core.addPath(toolDirectory);
core.exportVariable(BUTLER_PATH, toolPath);
core.info(`${BUTLER_PATH} -> ${toolPath}`);
Expand Down Expand Up @@ -28840,19 +28840,19 @@ async function findOrDownload() {
if (IS_LINUX || IS_MAC) {
await exec.exec(`chmod +x ${downloadDirectory}`);
}
core.debug(`Successfully extracted ${butler} to ${downloadDirectory}`);
core.info(`Successfully extracted ${butler} to ${downloadDirectory}`);
tool = path.join(downloadDirectory, toolPath);
const downloadVersion = await getVersion(tool);
core.debug(`Setting tool cache: ${downloadDirectory} | ${butler} | ${downloadVersion}`);
core.info(`Setting tool cache: ${downloadDirectory} | ${butler} | ${downloadVersion}`);
toolDirectory = await tc.cacheDir(downloadDirectory, butler, downloadVersion);
}
else {
tool = path.join(toolDirectory, toolPath);
const selfUpdate = (core.getInput('self-update') || 'true').trim().toLowerCase();
if (selfUpdate === 'true') {
core.debug(`Attempting to upgrade ${butler}...`);
core.info(`Attempting to upgrade ${butler}...`);
await exec.exec(tool, ['upgrade']);
core.debug(`Successfully upgraded ${butler}!`);
core.info(`Successfully upgraded ${butler}!`);
}
}
await fs.promises.access(tool);
Expand All @@ -28870,6 +28870,7 @@ async function getLatestVersion() {
}
}
});
core.info(`Latest version: ${output}`);
return output.trim();
}
const variantMap = {
Expand All @@ -28879,7 +28880,7 @@ const variantMap = {
};
function getDownloadUrl(version) {
const variant = variantMap[process.platform];
const baseUrl = 'https://broth.itch.zone/butler/';
const baseUrl = 'https://broth.itch.ovh/butler/';
const archiveName = `butler-${variantMap[process.platform]}.zip`;
return [`${baseUrl}${variant}/${version}/archive/default/${archiveName}`, archiveName];
}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const toolPath = `${butler}${toolExtension}`;

export async function Run(): Promise<void> {
const toolDirectory = await findOrDownload();
core.debug(`${BUTLER_DIR} -> ${toolDirectory}`);
core.info(`${BUTLER_DIR} -> ${toolDirectory}`);
core.addPath(toolDirectory);
core.exportVariable(BUTLER_PATH, toolPath);
core.info(`${BUTLER_PATH} -> ${toolPath}`);
Expand Down Expand Up @@ -55,18 +55,18 @@ async function findOrDownload(): Promise<string> {
if (IS_LINUX || IS_MAC) {
await exec.exec(`chmod +x ${downloadDirectory}`);
}
core.debug(`Successfully extracted ${butler} to ${downloadDirectory}`);
core.info(`Successfully extracted ${butler} to ${downloadDirectory}`);
tool = path.join(downloadDirectory, toolPath);
const downloadVersion = await getVersion(tool);
core.debug(`Setting tool cache: ${downloadDirectory} | ${butler} | ${downloadVersion}`);
core.info(`Setting tool cache: ${downloadDirectory} | ${butler} | ${downloadVersion}`);
toolDirectory = await tc.cacheDir(downloadDirectory, butler, downloadVersion);
} else {
tool = path.join(toolDirectory, toolPath);
const selfUpdate = (core.getInput('self-update') || 'true').trim().toLowerCase();
if (selfUpdate === 'true') {
core.debug(`Attempting to upgrade ${butler}...`);
core.info(`Attempting to upgrade ${butler}...`);
await exec.exec(tool, ['upgrade']);
core.debug(`Successfully upgraded ${butler}!`);
core.info(`Successfully upgraded ${butler}!`);
}
}
await fs.promises.access(tool);
Expand All @@ -85,6 +85,7 @@ async function getLatestVersion(): Promise<string> {
}
}
});
core.info(`Latest version: ${output}`);
return output.trim();
}

Expand All @@ -96,7 +97,7 @@ const variantMap = {

function getDownloadUrl(version: string): [string, string] {
const variant = variantMap[process.platform];
const baseUrl = 'https://broth.itch.zone/butler/';
const baseUrl = 'https://broth.itch.ovh/butler/';
const archiveName = `butler-${variantMap[process.platform]}.zip`;
return [`${baseUrl}${variant}/${version}/archive/default/${archiveName}`, archiveName];
}
Expand Down

0 comments on commit 7073b9c

Please sign in to comment.