mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-08-19 03:56:16 +00:00
hotfix for github release API rate limit token
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
.env
|
||||
node_modules
|
||||
install-*.sh
|
||||
install-*.bat
|
||||
|
||||
+14
-2
@@ -1,5 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
require('dotenv').config();
|
||||
|
||||
/**
|
||||
* Gets the releases for 'ripgrep'. This function could be trimmed down and made
|
||||
* for use with any github release.
|
||||
@@ -21,10 +23,20 @@ function getAllReleases(
|
||||
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: [],
|
||||
|
||||
Generated
+5
@@ -9,6 +9,11 @@
|
||||
"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",
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
"homepage": "https://github.com/webinstall/packages#readme",
|
||||
"dependencies": {
|
||||
"@root/request": "^1.6.1",
|
||||
"dotenv": "^8.2.0",
|
||||
"shmatter": "^1.0.1"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user