];
var archMap = {
//amd64: /(amd.?64|x64|[_\-]64)/i,
- amd64: /(\b|_|amd|(dar)?win(dows)?|mac(os)?|linux|osx|x)64(\b|_)/i,
+ amd64:
+ /(\b|_|amd|(dar)?win(dows)?|mac(os)?|linux|osx|x)64([_\-]?bit)?(\b|_)/i,
//x86: /(86)(\b|_)/i,
- x86: /(\b|_|amd|(dar)?win(dows)?|mac(os)?|linux|osx|x)(86|32)(\b|_)/i,
+ x86: /(\b|_|amd|(dar)?win(dows)?|mac(os)?|linux|osx|x)(86|32)([_\-]?bit)(\b|_)/i,
ppc64le: /(\b|_)(ppc64le)/i,
ppc64: /(\b|_)(ppc64)(\b|_)/i,
arm64: /(\b|_)((aarch|arm)64|arm)/i,
rel.arch = arch;
return true;
}
- })[0];
+ });
+ }
+ if (!rel.arch) {
+ if ('macos' === rel.os) {
+ rel.arch = 'amd64';
+ }
}
supported.arches[rel.arch] = true;
+ var tarExt;
if (!rel.ext) {
// pkg-v1.0.tar.gz => ['gz', 'tar', '0', 'pkg-v1']
// pkg-v1.0.tar => ['tar', '0' ,'pkg-v1']
exts = exts.reverse().slice(0, 2);
if ('tar' === exts[1]) {
rel.ext = exts.reverse().join('.');
+ tarExt = 'tar';
} else if ('tgz' == exts[0]) {
rel.ext = 'tar.gz';
+ tarExt = 'tar';
} else {
rel.ext = exts[0];
}
rel.ext = 'exe';
}
}
- supported.formats[rel.ext] = true;
+ supported.formats[tarExt || rel.ext] = true;
if (all.download) {
rel.download = all.download.replace(/{{ download }}/, rel.download);
}
module.exports = normalize;
+module.exports._debug = function (all) {
+ all = normalize(all);
+ all.releases = all.releases
+ .filter(function (r) {
+ return ['windows', 'macos', 'linux'].includes(r.os) && 'amd64' === r.arch;
+ })
+ .slice(0, 10);
+ return all;
+};
// NOT in order of priority (which would be tar, xz, zip, ...)
module.exports.formats = formats;
module.exports.arches = arches;