From: AJ ONeal Date: Sun, 3 May 2020 10:46:27 +0000 (+0000) Subject: add gitea and pathman X-Git-Url: https://git.josue.xyz/?a=commitdiff_plain;h=c32ea6d98e263436d3409da7ef0e4177b9c27da5;p=webi-installers%2F.git add gitea and pathman --- diff --git a/_common/gitea.js b/_common/gitea.js index 425d7d7..a3aa574 100644 --- a/_common/gitea.js +++ b/_common/gitea.js @@ -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)); } diff --git a/_common/github.js b/_common/github.js index eb117eb..aeaf025 100644 --- a/_common/github.js +++ b/_common/github.js @@ -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 index 0000000..e57e5d3 --- /dev/null +++ b/pathman/releases.js @@ -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)); + }); +}