From 36af48acebbcc2786f318d9cffbd790c620567b3 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 5 Jun 2024 08:23:02 +0000 Subject: [PATCH] ref(github-like): rename _common/githubish.js --- _common/gitea.js | 11 +++++++++-- _common/{github.js => githubish.js} | 10 +++++----- 2 files changed, 14 insertions(+), 7 deletions(-) rename _common/{github.js => githubish.js} (93%) 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)); },