Skip to content

Commit

Permalink
Fixed filename detection for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
changesbyjames committed Nov 23, 2024
1 parent 7e3dc3d commit 00ec48b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions census/api/src/services/twitch/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ export const getAppropriateBinary = async () => {
const asset = data.assets.find(asset => {
const filename = asset.name.match(/(?<=-)(.*)(?=.zip)/)?.[0];
if (!filename) throw new Error(`Invalid filename: ${asset.name}`);
const [, architecture] = filename.split('-');
return architecture === `${getOS(process.platform)}${getArch(process.arch)}`;
return filename.endsWith(`${getOS(process.platform)}${getArch(process.arch)}`);
});
if (!asset) {
throw new Error(`No binary found for ${getOS(process.platform)}${getArch(process.arch)}`);
Expand Down

0 comments on commit 00ec48b

Please sign in to comment.