refactor: finish moving ssh-* scripts to own installers
[webi-installers/.git] / git / releases.js
1 'use strict';
2
3 var github = require('../_common/github.js');
4 var owner = 'git-for-windows';
5 var repo = 'git';
6
7 module.exports = function (request) {
8   // TODO support mac and linux tarballs
9   return github(request, owner, repo).then(function (all) {
10     // See https://github.com/git-for-windows/git/wiki/MinGit
11     // also consider https://github.com/git-for-windows/git/wiki/Silent-or-Unattended-Installation
12     all.releases = all.releases
13       .filter(function (rel) {
14         rel.os = 'windows';
15         return (
16           /MinGit/i.test(rel.name || rel.download) &&
17           !/busybox/i.test(rel.name || rel.download)
18         );
19       })
20       .slice(0, 20);
21     return all;
22   });
23 };
24
25 if (module === require.main) {
26   module.exports(require('@root/request')).then(function (all) {
27     all = require('../_webi/normalize.js')(all);
28     console.info(JSON.stringify(all, null, 2));
29   });
30 }