mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-04-05 18:06:50 +00:00
ref!(githubish-source): bring over updates from 'githubish'
This commit is contained in:
40
_common/github-source.js
Normal file
40
_common/github-source.js
Normal file
@@ -0,0 +1,40 @@
|
||||
'use strict';
|
||||
|
||||
require('dotenv').config({ path: '.env' });
|
||||
|
||||
let GitHubSource = module.exports;
|
||||
|
||||
let GitHubishSource = require('./githubish-source.js');
|
||||
|
||||
/**
|
||||
* @param {Object} opts
|
||||
* @param {String} opts.owner
|
||||
* @param {String} opts.repo
|
||||
* @param {String} opts.baseurl
|
||||
* @param {String} [opts.username]
|
||||
* @param {String} [opts.token]
|
||||
*/
|
||||
GitHubSource.getDistributables = async function ({
|
||||
owner,
|
||||
repo,
|
||||
baseurl = 'https://api.github.com',
|
||||
username = process.env.GITHUB_USERNAME || '',
|
||||
token = process.env.GITHUB_TOKEN || '',
|
||||
}) {
|
||||
let all = await GitHubishSource.getDistributables({
|
||||
owner,
|
||||
repo,
|
||||
baseurl,
|
||||
username,
|
||||
token,
|
||||
});
|
||||
return all;
|
||||
};
|
||||
|
||||
if (module === require.main) {
|
||||
GitHubSource.getDistributables(null, 'BeyondCodeBootcamp', 'DuckDNS.sh').then(
|
||||
function (all) {
|
||||
console.info(JSON.stringify(all, null, 2));
|
||||
},
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user