go-ethereum/src/utils/getReleaseArch.ts
Corwin Smith 4aa8f214fb
[sorting] releases should be sorted by date, then by type (Geth, then Geth + tools) (#158)
* create constant for number of releases per os

* sort releases

* Apply suggestions from code review

* change requests

* fix build error

* cleanup

* fix: typo & prettier

* refactor sort function

* cleanup unnecessary changes

* fix: getReleaseArch case

* fix sort

* prettier

Co-authored-by: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Co-authored-by: Nicolás Quiroz <nh.quiroz@gmail.com>
2022-12-15 12:27:49 -03:00

28 lines
622 B
TypeScript

export const getReleaseArch = (filename: string) => {
const arch = filename.includes('alltools') ? filename.split('-')[3] : filename.split('-')[2];
switch (arch) {
case '386':
return '32-bit';
case 'amd64':
return '64-bit';
case 'arm5':
return 'ARMv5';
case 'arm6':
return 'ARMv6';
case 'arm7':
return 'ARMv7';
case 'arm64':
return 'ARM64';
case 'mips':
return 'MIPS32';
case 'mipsle':
return 'MIPS32(le)';
case 'mips64':
return 'MIPS64';
case 'mips64le':
return 'MIPS64(le)';
default:
return 'all';
}
};