Skip to content

Commit

Permalink
ref: automated removal of unused request
Browse files Browse the repository at this point in the history
  • Loading branch information
coolaj86 committed Oct 14, 2024
1 parent 93e6c64 commit c3448af
Show file tree
Hide file tree
Showing 71 changed files with 208 additions and 212 deletions.
5 changes: 2 additions & 3 deletions _common/gitea.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ var GitHubish = require('./githubish.js');
/**
* Lists Gitea Releases (w/ uploaded assets)
*
* @param {any} _request - deprecated
* @param {null} _ - deprecated
* @param {String} owner
* @param {String} repo
* @param {String} baseurl
* @param {String} [username]
* @param {String} [token]
*/
async function getDistributables(
_request,
_,
owner,
repo,
baseurl,
Expand Down Expand Up @@ -42,7 +42,6 @@ if (module === require.main) {
'',
'',
).then(
//getDistributables(require('@root/request'), 'root', 'serviceman', 'https://git.rootprojects.org').then(
function (all) {
console.info(JSON.stringify(all, null, 2));
},
Expand Down
4 changes: 2 additions & 2 deletions _common/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ let GitHubish = require('./githubish.js');
/**
* Lists GitHub Releases (w/ uploaded assets)
*
* @param {null} _request - deprecated
* @param {null} _ - deprecated
* @param {String} owner
* @param {String} repo
* @param {String} [baseurl]
* @param {String} [username]
* @param {String} [token]
*/
module.exports = async function (
_request,
_,
owner,
repo,
baseurl = 'https://api.github.com',
Expand Down
7 changes: 3 additions & 4 deletions _example/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ var repo = 'ripgrep';

let Releases = module.exports;

Releases.latest = async function (request) {
let all = await github(request, owner, repo);
Releases.latest = async function () {
let all = await github(null, owner, repo);
return all;
};

Releases.sample = async function () {
let request = require('@root/request');
let normalize = require('../_webi/normalize.js');
let all = await module.exports(request);
let all = await Releases.latest();
all = normalize(all);
// just select the first 5 for demonstration
all.releases = all.releases.slice(0, 5);
Expand Down
1 change: 0 additions & 1 deletion _npm/scripts/install-webi.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

//var pkg = require('../package.json');
var os = require('os');
//var request = require('@root/request');
//var promisify = require('util').promisify;
//var exec = promisify(require('child_process').exec);
var exec = require('child_process').exec;
Expand Down
6 changes: 3 additions & 3 deletions arc/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ var github = require('../_common/github.js');
var owner = 'mholt';
var repo = 'archiver';

module.exports = function (request) {
return github(request, owner, repo).then(function (all) {
module.exports = function () {
return github(null, owner, repo).then(function (all) {
all._names = ['archiver', 'arc'];
return all;
});
};

if (module === require.main) {
module.exports(require('@root/request')).then(function (all) {
module.exports().then(function (all) {
all = require('../_webi/normalize.js')(all);
// just select the first 5 for demonstration
all.releases = all.releases.slice(0, 5);
Expand Down
6 changes: 3 additions & 3 deletions atomicparsley/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ let targets = {
},
};

module.exports = function (request) {
return github(request, owner, repo).then(function (all) {
module.exports = function () {
return github(null, owner, repo).then(function (all) {
for (let rel of all.releases) {
let windows32 = rel.name.includes('WindowsX86.');
if (windows32) {
Expand Down Expand Up @@ -71,7 +71,7 @@ module.exports = function (request) {
};

if (module === require.main) {
module.exports(require('@root/request')).then(function (all) {
module.exports().then(function (all) {
all = require('../_webi/normalize.js')(all);
console.info(JSON.stringify(all));
//console.info(JSON.stringify(all, null, 2));
Expand Down
6 changes: 3 additions & 3 deletions awless/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ var github = require('../_common/github.js');
var owner = 'wallix';
var repo = 'awless';

module.exports = function (request) {
return github(request, owner, repo).then(function (all) {
module.exports = function () {
return github(null, owner, repo).then(function (all) {
// remove checksums and .deb
all.releases = all.releases.filter(function (rel) {
return !/(\.txt)|(\.deb)$/i.test(rel.name);
Expand All @@ -15,7 +15,7 @@ module.exports = function (request) {
};

if (module === require.main) {
module.exports(require('@root/request')).then(function (all) {
module.exports().then(function (all) {
all = require('../_webi/normalize.js')(all);
console.info(JSON.stringify(all));
});
Expand Down
6 changes: 3 additions & 3 deletions bat/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ var github = require('../_common/github.js');
var owner = 'sharkdp';
var repo = 'bat';

module.exports = function (request) {
return github(request, owner, repo).then(function (all) {
module.exports = function () {
return github(null, owner, repo).then(function (all) {
return all;
});
};

if (module === require.main) {
module.exports(require('@root/request')).then(function (all) {
module.exports().then(function (all) {
all = require('../_webi/normalize.js')(all);
all.releases = all.releases.slice(0, 10);
//console.info(JSON.stringify(all));
Expand Down
6 changes: 3 additions & 3 deletions bun/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ var github = require('../_common/github.js');
var owner = 'oven-sh';
var repo = 'bun';

module.exports = function (request) {
return github(request, owner, repo).then(function (all) {
module.exports = function () {
return github(null, owner, repo).then(function (all) {
all.releases = all.releases
.filter(function (r) {
let isDebug = r.name.includes('-profile');
Expand All @@ -30,7 +30,7 @@ module.exports = function (request) {
};

if (module === require.main) {
module.exports(require('@root/request')).then(function (all) {
module.exports().then(function (all) {
all = require('../_webi/normalize.js')(all);
// just select the first 5 for demonstration
all.releases = all.releases.slice(0, 5);
Expand Down
6 changes: 3 additions & 3 deletions caddy/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ var github = require('../_common/github.js');
var owner = 'caddyserver';
var repo = 'caddy';

module.exports = function (request) {
return github(request, owner, repo).then(function (all) {
module.exports = function () {
return github(null, owner, repo).then(function (all) {
// remove checksums and .deb
all.releases = all.releases.filter(function (rel) {
let isOneOffAsset = rel.download.includes('buildable-artifact');
Expand All @@ -20,7 +20,7 @@ module.exports = function (request) {
};

if (module === require.main) {
module.exports(require('@root/request')).then(function (all) {
module.exports().then(function (all) {
all = require('../_webi/normalize.js')(all);
console.info(JSON.stringify(all));
});
Expand Down
7 changes: 3 additions & 4 deletions cilium/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ var github = require('../_common/github.js');
var owner = 'cilium';
var repo = 'cilium-cli';

module.exports = async function (request) {
let all = await github(request, owner, repo);
module.exports = async function () {
let all = await github(null, owner, repo);
return all;
};

if (module === require.main) {
(async function () {
let request = require('@root/request');
let normalize = require('../_webi/normalize.js');
let all = await module.exports(request);
let all = await module.exports();
all = normalize(all);
// just select the first 5 for demonstration
all.releases = all.releases.slice(0, 5);
Expand Down
6 changes: 3 additions & 3 deletions cmake/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ var github = require('../_common/github.js');
var owner = 'Kitware';
var repo = 'CMake';

module.exports = function (request) {
return github(request, owner, repo).then(function (all) {
module.exports = function () {
return github(null, owner, repo).then(function (all) {
for (let rel of all.releases) {
if (rel.version.startsWith('v')) {
rel._version = rel.version.slice(1);
Expand Down Expand Up @@ -44,7 +44,7 @@ module.exports = function (request) {
};

if (module === require.main) {
module.exports(require('@root/request')).then(function (all) {
module.exports().then(function (all) {
all = require('../_webi/normalize.js')(all);
// just select the first 5 for demonstration
all.releases = all.releases.slice(0, 5);
Expand Down
6 changes: 3 additions & 3 deletions comrak/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ var repo = 'comrak';

var ODDITIES = ['-musleabihf.1-'];

module.exports = function (request) {
return github(request, owner, repo).then(function (all) {
module.exports = function () {
return github(null, owner, repo).then(function (all) {
let builds = [];

loopBuilds: for (let build of all.releases) {
Expand All @@ -31,7 +31,7 @@ module.exports = function (request) {
};

if (module === require.main) {
module.exports(require('@root/request')).then(function (all) {
module.exports().then(function (all) {
all = require('../_webi/normalize.js')(all);
all.releases = all.releases.slice(0, 10);
//console.info(JSON.stringify(all));
Expand Down
6 changes: 3 additions & 3 deletions crabz/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ var github = require('../_common/github.js');
var owner = 'sstadick';
var repo = 'crabz';

module.exports = async function (request) {
let all = await github(request, owner, repo);
module.exports = async function () {
let all = await github(null, owner, repo);

let releases = [];
for (let rel of all.releases) {
Expand All @@ -22,7 +22,7 @@ module.exports = async function (request) {
};

if (module === require.main) {
module.exports(require('@root/request')).then(function (all) {
module.exports().then(function (all) {
all = require('../_webi/normalize.js')(all);
// just select the first 5 for demonstration
all.releases = all.releases.slice(0, 5);
Expand Down
6 changes: 3 additions & 3 deletions curlie/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ var github = require('../_common/github.js');
var owner = 'rs';
var repo = 'curlie';

module.exports = function (request) {
return github(request, owner, repo).then(function (all) {
module.exports = function () {
return github(null, owner, repo).then(function (all) {
all._names = ['curlie', 'curl-httpie'];
return all;
});
};

if (module === require.main) {
module.exports(require('@root/request')).then(function (all) {
module.exports().then(function (all) {
all = require('../_webi/normalize.js')(all);
all.releases = all.releases.slice(0, 10);
//console.info(JSON.stringify(all));
Expand Down
6 changes: 3 additions & 3 deletions dashcore/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ var github = require('../_common/github.js');
var owner = 'dashpay';
var repo = 'dash';

module.exports = function (request) {
return github(request, owner, repo).then(function (all) {
module.exports = function () {
return github(null, owner, repo).then(function (all) {
all.releases.forEach(function (rel) {
if (rel.name.includes('osx64')) {
rel.os = 'macos';
Expand All @@ -22,7 +22,7 @@ module.exports = function (request) {
};

if (module === require.main) {
module.exports(require('@root/request')).then(function (all) {
module.exports().then(function (all) {
all = require('../_webi/normalize.js')(all);
// just select the first 5 for demonstration
all.releases = all.releases.slice(0, 5);
Expand Down
6 changes: 3 additions & 3 deletions dashmsg/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ var github = require('../_common/github.js');
var owner = 'dashhive';
var repo = 'dashmsg';

module.exports = function (request) {
return github(request, owner, repo).then(function (all) {
module.exports = function () {
return github(null, owner, repo).then(function (all) {
return all;
});
};

if (module === require.main) {
module.exports(require('@root/request')).then(function (all) {
module.exports().then(function (all) {
all = require('../_webi/normalize.js')(all);
console.info(JSON.stringify(all, null, 2));
});
Expand Down
6 changes: 3 additions & 3 deletions delta/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ var github = require('../_common/github.js');
var owner = 'dandavison';
var repo = 'delta';

module.exports = function (request) {
return github(request, owner, repo).then(function (all) {
module.exports = function () {
return github(null, owner, repo).then(function (all) {
return all;
});
};

if (module === require.main) {
module.exports(require('@root/request')).then(function (all) {
module.exports().then(function (all) {
all = require('../_webi/normalize.js')(all);
// just select the first 15 for demonstration
all.releases = all.releases.slice(0, 15);
Expand Down
6 changes: 3 additions & 3 deletions deno/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ var github = require('../_common/github.js');
var owner = 'denoland';
var repo = 'deno';

module.exports = function (request) {
return github(request, owner, repo).then(function (all) {
module.exports = function () {
return github(null, owner, repo).then(function (all) {
// remove checksums and .deb
all.releases = all.releases
.filter(function (rel) {
Expand Down Expand Up @@ -35,7 +35,7 @@ module.exports = function (request) {
};

if (module === require.main) {
module.exports(require('@root/request')).then(function (all) {
module.exports().then(function (all) {
all = require('../_webi/normalize.js')(all);
console.info(JSON.stringify(all, null, 2));
});
Expand Down
6 changes: 3 additions & 3 deletions dotenv-linter/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ var github = require('../_common/github.js');
var owner = 'dotenv-linter';
var repo = 'dotenv-linter';

module.exports = function (request) {
return github(request, owner, repo).then(function (all) {
module.exports = function () {
return github(null, owner, repo).then(function (all) {
return all;
});
};

if (module === require.main) {
module.exports(require('@root/request')).then(function (all) {
module.exports().then(function (all) {
all = require('../_webi/normalize.js')(all);
// just select the first 5 for demonstration
all.releases = all.releases.slice(0, 5);
Expand Down
6 changes: 3 additions & 3 deletions dotenv/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ var github = require('../_common/github.js');
var owner = 'therootcompany';
var repo = 'dotenv';

module.exports = function (request) {
return github(request, owner, repo).then(function (all) {
module.exports = function () {
return github(null, owner, repo).then(function (all) {
return all;
});
};

if (module === require.main) {
module.exports(require('@root/request')).then(function (all) {
module.exports().then(function (all) {
all = require('../_webi/normalize.js')(all);
console.info(JSON.stringify(all));
});
Expand Down
Loading

0 comments on commit c3448af

Please sign in to comment.