add xz support, add gitea
[webi-installers/.git] / gitea / releases.js
diff --git a/gitea/releases.js b/gitea/releases.js
new file mode 100644 (file)
index 0000000..80eb1bb
--- /dev/null
@@ -0,0 +1,23 @@
+'use strict';
+
+var github = require('../_common/github.js');
+var owner = 'go-gitea';
+var repo = 'gitea';
+
+module.exports = function (request) {
+  return github(request, owner, repo).then(function (all) {
+    // remove checksums and .deb
+    all.releases = all.releases.filter(function (rel) {
+      return !/(\.asc)|(\.sha256)|(\.\d-[^\.]*)$/i.test(rel.name);
+    });
+    return all;
+  });
+};
+
+if (module === require.main) {
+  module.exports(require('@root/request')).then(function (all) {
+    all = require('../_common/normalize.js')(all);
+    console.info(JSON.stringify(all));
+    //console.info(JSON.stringify(all, null, 2));
+  });
+}