add gitea and pathman
authorAJ ONeal <aj@therootcompany.com>
Sun, 3 May 2020 10:46:27 +0000 (10:46 +0000)
committerAJ ONeal <aj@therootcompany.com>
Sun, 3 May 2020 10:46:27 +0000 (10:46 +0000)
_common/gitea.js
_common/github.js
pathman/releases.js [new file with mode: 0644]

index 425d7d7e005f4bf0d09fead755e82d16780b9cc6..a3aa574397e2ae1875b9fbb6db11a378356bf0b5 100644 (file)
@@ -23,7 +23,8 @@ function getAllReleases(request, owner, repo, baseurl) {
 module.exports = getAllReleases;
 
 if (module === require.main) {
-  getAllReleases(require('@root/request'), 'root', 'serviceman', 'https://git.rootprojects.org').then(
+  getAllReleases(require('@root/request'), 'coolaj86', 'go-pathman', 'https://git.coolaj86.com').then(
+  //getAllReleases(require('@root/request'), 'root', 'serviceman', 'https://git.rootprojects.org').then(
     function (all) {
       console.log(JSON.stringify(all, null, 2));
     }
index eb117ebb5028079c85228ffb96ff5c487e928a23..aeaf025844e642ddea7ea920528e2ca3c2cb4d56 100644 (file)
@@ -31,6 +31,7 @@ function getAllReleases(request, owner, repo, baseurl = 'https://api.github.com'
       release['assets'].forEach((asset) => {
         const name = asset['name'];
         all.releases.push({
+          name: name,
           version: release['tag_name'], // TODO tags aren't always semver / sensical
           lts: /\b(lts)\b/.test(release['tag_name']),
           channel: !release['prerelease'] ? 'stable' : 'beta',
diff --git a/pathman/releases.js b/pathman/releases.js
new file mode 100644 (file)
index 0000000..e57e5d3
--- /dev/null
@@ -0,0 +1,18 @@
+'use strict';
+
+var github = require('../_common/gitea.js');
+var owner = 'coolaj86';
+var repo = 'go-pathman';
+var baseurl = 'https://git.coolaj86.com'
+
+module.exports = function (request) {
+  return github(request, owner, repo, baseurl).then(function (all) {
+    return all;
+  });
+};
+
+if (module === require.main) {
+  module.exports(require('@root/request')).then(function (all) {
+    console.log(JSON.stringify(all, null, 2));
+  });
+}