diff --git a/_common/gitea.js b/_common/gitea.js index 26669d0..ec2cf71 100644 --- a/_common/gitea.js +++ b/_common/gitea.js @@ -1,6 +1,6 @@ 'use strict'; -var ghRelease = require('./github.js'); +var GitHubish = require('./githubish.js'); /** * Lists Gitea Releases (w/ uploaded assets) @@ -24,7 +24,14 @@ async function getAllReleases( throw new Error('missing baseurl'); } baseurl = `${baseurl}/api/v1`; - let all = await ghRelease(request, owner, repo, baseurl, username, token); + let all = await GitHubish.getAllReleases( + request, + owner, + repo, + baseurl, + username, + token, + ); return all; } diff --git a/_common/github.js b/_common/githubish.js similarity index 93% rename from _common/github.js rename to _common/githubish.js index 1a62705..69f1ed4 100644 --- a/_common/github.js +++ b/_common/githubish.js @@ -2,6 +2,8 @@ require('dotenv').config(); +let GitHubish = module.exports; + /** * Lists GitHub Releases (w/ uploaded assets) * @@ -12,7 +14,7 @@ require('dotenv').config(); * @param {String} [username] * @param {String} [token] */ -async function getAllReleases( +GitHubish.getAllReleases = async function ( request, owner, repo, @@ -92,12 +94,10 @@ async function getAllReleases( } return all; -} - -module.exports = getAllReleases; +}; if (module === require.main) { - getAllReleases(require('@root/request'), 'BurntSushi', 'ripgrep').then( + GitHubish.getAllReleases(require('@root/request'), 'BurntSushi', 'ripgrep').then( function (all) { console.info(JSON.stringify(all, null, 2)); },