'use strict';
+require('dotenv').config();
+
/**
* Gets the releases for 'ripgrep'. This function could be trimmed down and made
* for use with any github release.
if (!repo) {
return Promise.reject('missing repo name');
}
- return request({
+
+ var req = {
url: `${baseurl}/repos/${owner}/${repo}/releases`,
json: true
- }).then((resp) => {
+ };
+ // TODO I really don't like global config, find a way to do better
+ if (process.env.GITHUB_USERNAME) {
+ req.auth = {
+ user: process.env.GITHUB_USERNAME,
+ pass: process.env.GITHUB_TOKEN
+ };
+ }
+
+ return request(req).then((resp) => {
const gHubResp = resp.body;
const all = {
releases: [],
"resolved": "https://registry.npmjs.org/@root/request/-/request-1.6.1.tgz",
"integrity": "sha512-8wrWyeBLRp7T8J36GkT3RODJ6zYmL0/maWlAUD5LOXT28D3TDquUepyYDKYANNA3Gc8R5ZCgf+AXvSTYpJEWwQ=="
},
+ "dotenv": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz",
+ "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw=="
+ },
"marked": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/marked/-/marked-1.1.0.tgz",
"homepage": "https://github.com/webinstall/packages#readme",
"dependencies": {
"@root/request": "^1.6.1",
+ "dotenv": "^8.2.0",
"shmatter": "^1.0.1"
}
}