add git and golang for windows, fix some PATH stuff
[webi-installers/.git] / git / releases.js
diff --git a/git/releases.js b/git/releases.js
new file mode 100644 (file)
index 0000000..caeac2a
--- /dev/null
@@ -0,0 +1,30 @@
+'use strict';
+
+var github = require('../_common/github.js');
+var owner = 'git-for-windows';
+var repo = 'git';
+
+module.exports = function (request) {
+  // TODO support mac and linux tarballs
+  return github(request, owner, repo).then(function (all) {
+    // See https://github.com/git-for-windows/git/wiki/MinGit
+    // also consider https://github.com/git-for-windows/git/wiki/Silent-or-Unattended-Installation
+    all.releases = all.releases
+      .filter(function (rel) {
+        rel.os = 'windows';
+        return (
+          /MinGit/i.test(rel.name || rel.download) &&
+          !/busybox/i.test(rel.name || rel.download)
+        );
+      })
+      .slice(0, 20);
+    return all;
+  });
+};
+
+if (module === require.main) {
+  module.exports(require('@root/request')).then(function (all) {
+    all = require('../_webi/normalize.js')(all);
+    console.info(JSON.stringify(all, null, 2));
+  });
+}