mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-05-16 13:46:42 +00:00
52 lines
1.1 KiB
JavaScript
52 lines
1.1 KiB
JavaScript
'use strict';
|
|
|
|
var github = require('../_common/github.js');
|
|
var owner = 'powershell';
|
|
var repo = 'powershell';
|
|
|
|
let ODDITIES = ['-fxdependent'];
|
|
|
|
function isOdd(build) {
|
|
for (let oddity of ODDITIES) {
|
|
let isOddity = build.name.includes(oddity);
|
|
if (isOddity) {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = function () {
|
|
return github(null, owner, repo).then(function (all) {
|
|
// remove checksums and .deb
|
|
all.releases = all.releases.filter(function (rel) {
|
|
let odd = isOdd(rel);
|
|
if (odd) {
|
|
return false;
|
|
}
|
|
|
|
let isPreview = rel.name.includes('-preview.');
|
|
if (isPreview) {
|
|
rel.channel = 'beta';
|
|
}
|
|
|
|
let isMusl = rel.download.match(/(\b|_)(musl|alpine)(\b|_)/i);
|
|
if (isMusl) {
|
|
// not a fully static build, not gnu-compatible
|
|
rel.libc = 'musl';
|
|
}
|
|
|
|
return true;
|
|
});
|
|
|
|
all._names = ['PowerShell', 'powershell'];
|
|
return all;
|
|
});
|
|
};
|
|
|
|
if (module === require.main) {
|
|
module.exports().then(function (all) {
|
|
all = require('../_webi/normalize.js')(all);
|
|
console.info(JSON.stringify(all));
|
|
});
|
|
}
|