mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-02-14 09:39:51 +00:00
41 lines
878 B
JavaScript
41 lines
878 B
JavaScript
'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));
|
|
},
|
|
);
|
|
}
|