mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-02-14 09:39:51 +00:00
chore(fmt): set .prettierrc.json.trailingComma = "all"
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"trailingComma": "none",
|
||||
"trailingComma": "all",
|
||||
"tabWidth": 2,
|
||||
"singleQuote": true,
|
||||
"proseWrap": "always"
|
||||
|
||||
@@ -14,7 +14,7 @@ function getAllReleases(request, formula) {
|
||||
return request({
|
||||
url: 'https://formulae.brew.sh/api/formula/' + formula + '.json',
|
||||
fail: true, // https://git.coolaj86.com/coolaj86/request.js/issues/2
|
||||
json: true
|
||||
json: true,
|
||||
})
|
||||
.then(failOnBadStatus)
|
||||
.then(function (resp) {
|
||||
@@ -26,16 +26,16 @@ function getAllReleases(request, formula) {
|
||||
return [
|
||||
{
|
||||
version: ver,
|
||||
download: dl.replace(/{{ v }}/g, ver)
|
||||
}
|
||||
download: dl.replace(/{{ v }}/g, ver),
|
||||
},
|
||||
].concat(
|
||||
resp.body.versioned_formulae.map(function (f) {
|
||||
var ver = f.replace(/.*@/, '');
|
||||
return {
|
||||
version: ver,
|
||||
download: dl
|
||||
download: dl,
|
||||
};
|
||||
})
|
||||
}),
|
||||
);
|
||||
})
|
||||
.catch(function (err) {
|
||||
|
||||
@@ -16,7 +16,7 @@ function getAllReleases(request, owner, repo, baseurl) {
|
||||
return Promise.reject('missing baseurl');
|
||||
}
|
||||
return ghRelease(request, owner, repo, baseurl + '/api/v1').then(function (
|
||||
all
|
||||
all,
|
||||
) {
|
||||
return all;
|
||||
});
|
||||
@@ -29,11 +29,11 @@ if (module === require.main) {
|
||||
require('@root/request'),
|
||||
'coolaj86',
|
||||
'go-pathman',
|
||||
'https://git.coolaj86.com'
|
||||
'https://git.coolaj86.com',
|
||||
).then(
|
||||
//getAllReleases(require('@root/request'), 'root', 'serviceman', 'https://git.rootprojects.org').then(
|
||||
function (all) {
|
||||
console.info(JSON.stringify(all, null, 2));
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ async function getAllReleases(
|
||||
repo,
|
||||
oses,
|
||||
arches,
|
||||
baseurl = 'https://api.github.com'
|
||||
baseurl = 'https://api.github.com',
|
||||
) {
|
||||
if (!owner) {
|
||||
return Promise.reject('missing owner for repo');
|
||||
@@ -28,14 +28,14 @@ async function getAllReleases(
|
||||
|
||||
let req = {
|
||||
url: `${baseurl}/repos/${owner}/${repo}/releases`,
|
||||
json: true
|
||||
json: true,
|
||||
};
|
||||
|
||||
// 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
|
||||
pass: process.env.GITHUB_TOKEN,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ async function getAllReleases(
|
||||
let all = {
|
||||
releases: [],
|
||||
// TODO make this ':baseurl' + ':releasename'
|
||||
download: ''
|
||||
download: '',
|
||||
};
|
||||
|
||||
for (let release of gHubResp) {
|
||||
@@ -66,7 +66,7 @@ async function getAllReleases(
|
||||
followAllRedirects: true,
|
||||
followOriginalHttpMethod: true,
|
||||
url: url,
|
||||
stream: true
|
||||
stream: true,
|
||||
});
|
||||
// Workaround for bug where method changes to GET
|
||||
resp.destroy();
|
||||
@@ -74,7 +74,7 @@ async function getAllReleases(
|
||||
// content-disposition: attachment; filename=BeyondCodeBootcamp-DuckDNS.sh-v1.0.1-0-ga2f4bde.zip
|
||||
let name = resp.headers['content-disposition'].replace(
|
||||
/.*filename=([^;]+)(;|$)/,
|
||||
'$1'
|
||||
'$1',
|
||||
);
|
||||
all.releases.push({
|
||||
name: name,
|
||||
@@ -85,7 +85,7 @@ async function getAllReleases(
|
||||
os: '', // will be guessed by download filename
|
||||
arch: '', // will be guessed by download filename
|
||||
ext: '', // will be normalized
|
||||
download: resp.request.uri.href
|
||||
download: resp.request.uri.href,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -108,7 +108,7 @@ function combinate(all, oses, arches) {
|
||||
for (let os of oses) {
|
||||
let combo = {
|
||||
arch: arch,
|
||||
os: os
|
||||
os: os,
|
||||
};
|
||||
let rel = Object.assign({}, release, combo);
|
||||
combos.push(rel);
|
||||
@@ -126,7 +126,7 @@ if (module === require.main) {
|
||||
getAllReleases(
|
||||
require('@root/request'),
|
||||
'BeyondCodeBootcamp',
|
||||
'DuckDNS.sh'
|
||||
'DuckDNS.sh',
|
||||
).then(function (all) {
|
||||
console.info(JSON.stringify(all, null, 2));
|
||||
});
|
||||
|
||||
@@ -15,7 +15,7 @@ function getAllReleases(
|
||||
request,
|
||||
owner,
|
||||
repo,
|
||||
baseurl = 'https://api.github.com'
|
||||
baseurl = 'https://api.github.com',
|
||||
) {
|
||||
if (!owner) {
|
||||
return Promise.reject('missing owner for repo');
|
||||
@@ -26,13 +26,13 @@ function getAllReleases(
|
||||
|
||||
var req = {
|
||||
url: `${baseurl}/repos/${owner}/${repo}/releases`,
|
||||
json: true
|
||||
json: true,
|
||||
};
|
||||
// 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
|
||||
pass: process.env.GITHUB_TOKEN,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ function getAllReleases(
|
||||
const all = {
|
||||
releases: [],
|
||||
// todo make this ':baseurl' + ':releasename'
|
||||
download: ''
|
||||
download: '',
|
||||
};
|
||||
|
||||
gHubResp.forEach((release) => {
|
||||
@@ -56,7 +56,7 @@ function getAllReleases(
|
||||
os: '', // will be guessed by download filename
|
||||
arch: '', // will be guessed by download filename
|
||||
ext: '', // will be normalized
|
||||
download: asset['browser_download_url']
|
||||
download: asset['browser_download_url'],
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -71,6 +71,6 @@ if (module === require.main) {
|
||||
getAllReleases(require('@root/request'), 'BurntSushi', 'ripgrep').then(
|
||||
function (all) {
|
||||
console.info(JSON.stringify(all, null, 2));
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ function spawner(args) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
var bin = args.shift();
|
||||
var runner = spawn(bin, args, {
|
||||
windowsHide: true
|
||||
windowsHide: true,
|
||||
});
|
||||
runner.stdout.on('data', function (chunk) {
|
||||
console.info(chunk.toString('utf8'));
|
||||
|
||||
@@ -57,7 +57,7 @@ function parseYamlish(txt) {
|
||||
var m = line.match(keyValRe);
|
||||
if (!m) {
|
||||
throw new Error(
|
||||
'invalid key format for: ' + JSON.stringify(line) + ' ' + i
|
||||
'invalid key format for: ' + JSON.stringify(line) + ' ' + i,
|
||||
);
|
||||
}
|
||||
if ('|' === m[2]) {
|
||||
@@ -79,6 +79,6 @@ module.exports.parse = parseYamlish;
|
||||
|
||||
if (require.main === module) {
|
||||
console.info(
|
||||
parseYamlish(fs.readFileSync(__dirname + '/../node/README.md', 'utf8'))
|
||||
parseYamlish(fs.readFileSync(__dirname + '/../node/README.md', 'utf8')),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -7,13 +7,13 @@ var osMap = {
|
||||
freebsd: /(\b|_)(freebsd)/i,
|
||||
windows: /(\b|_)(win|microsoft|msft)/i,
|
||||
sunos: /(\b|_)(sun)/i,
|
||||
aix: /(\b|_)(aix)/i
|
||||
aix: /(\b|_)(aix)/i,
|
||||
};
|
||||
|
||||
var maps = {
|
||||
oses: {},
|
||||
arches: {},
|
||||
formats: {}
|
||||
formats: {},
|
||||
};
|
||||
|
||||
Object.keys(osMap).forEach(function (name) {
|
||||
@@ -39,7 +39,7 @@ var arches = [
|
||||
'x86',
|
||||
'ppc64le',
|
||||
'ppc64',
|
||||
's390x'
|
||||
's390x',
|
||||
];
|
||||
// Used for detecting system arch from package download url, for example:
|
||||
//
|
||||
@@ -59,7 +59,7 @@ var archMap = {
|
||||
x86: /(\b|_|amd|(dar)?win(dows)?|mac(os)?|linux|osx|x)(86|32)([_\-]?bit)(\b|_)/i,
|
||||
ppc64le: /(\b|_)(ppc64le)/i,
|
||||
ppc64: /(\b|_)(ppc64)(\b|_)/i,
|
||||
s390x: /(\b|_)(s390x)/i
|
||||
s390x: /(\b|_)(s390x)/i,
|
||||
};
|
||||
arches.forEach(function (name) {
|
||||
maps.arches[name] = true;
|
||||
@@ -69,7 +69,7 @@ function normalize(all) {
|
||||
var supported = {
|
||||
oses: {},
|
||||
arches: {},
|
||||
formats: {}
|
||||
formats: {},
|
||||
};
|
||||
|
||||
all.releases.forEach(function (rel) {
|
||||
|
||||
@@ -70,7 +70,7 @@ pkgs.create = function (Pkgs, basepath) {
|
||||
console.error("failed to read '" + node + "/install.ps1'");
|
||||
console.error(e);
|
||||
}
|
||||
})
|
||||
}),
|
||||
]).then(function (items) {
|
||||
var meta = items[0] || items[1];
|
||||
if (!meta) {
|
||||
|
||||
@@ -27,7 +27,7 @@ function padScript(txt) {
|
||||
Releases.renderBash = function (
|
||||
pkgdir,
|
||||
rel,
|
||||
{ baseurl, pkg, tag, ver, os = '', arch = '', formats }
|
||||
{ baseurl, pkg, tag, ver, os = '', arch = '', formats },
|
||||
) {
|
||||
if (!Array.isArray(formats)) {
|
||||
formats = [];
|
||||
@@ -47,7 +47,7 @@ Releases.renderBash = function (
|
||||
build: vers
|
||||
.join('.')
|
||||
.replace(/[^+\-]*/, '')
|
||||
.replace(/^-/, '')
|
||||
.replace(/^-/, ''),
|
||||
};
|
||||
var pkgFile = rel.filename || rel.name;
|
||||
return fs.promises
|
||||
@@ -81,7 +81,7 @@ Releases.renderBash = function (
|
||||
'&formats=' +
|
||||
formats.join(',') +
|
||||
'&pretty=true' +
|
||||
"'"
|
||||
"'",
|
||||
)
|
||||
.replace(
|
||||
/^\s*#?WEBI_CSV=.*/m,
|
||||
@@ -97,15 +97,15 @@ Releases.renderBash = function (
|
||||
'-',
|
||||
rel.download,
|
||||
rel.name,
|
||||
rel.comment || ''
|
||||
rel.comment || '',
|
||||
]
|
||||
.join(',')
|
||||
.replace(/'/g, '') +
|
||||
"'"
|
||||
"'",
|
||||
)
|
||||
.replace(
|
||||
/^\s*#?WEBI_VERSION=.*/m,
|
||||
'WEBI_VERSION=' + JSON.stringify(rel.version)
|
||||
'WEBI_VERSION=' + JSON.stringify(rel.version),
|
||||
)
|
||||
.replace(/^\s*#?WEBI_MAJOR=.*/m, 'WEBI_MAJOR=' + v.major)
|
||||
.replace(/^\s*#?WEBI_MINOR=.*/m, 'WEBI_MINOR=' + v.minor)
|
||||
@@ -115,33 +115,33 @@ Releases.renderBash = function (
|
||||
.replace(/^\s*#?WEBI_CHANNEL=.*/m, 'WEBI_CHANNEL=' + rel.channel)
|
||||
.replace(
|
||||
/^\s*#?WEBI_EXT=.*/m,
|
||||
'WEBI_EXT=' + rel.ext.replace(/tar.*/, 'tar')
|
||||
'WEBI_EXT=' + rel.ext.replace(/tar.*/, 'tar'),
|
||||
)
|
||||
.replace(
|
||||
/^\s*#?WEBI_FORMATS=.*/m,
|
||||
"WEBI_FORMATS='" + formats.join(',') + "'"
|
||||
"WEBI_FORMATS='" + formats.join(',') + "'",
|
||||
)
|
||||
.replace(
|
||||
/^\s*#?WEBI_PKG_URL=.*/m,
|
||||
"WEBI_PKG_URL='" + rel.download + "'"
|
||||
"WEBI_PKG_URL='" + rel.download + "'",
|
||||
)
|
||||
.replace(
|
||||
/^\s*#?WEBI_PKG_FILE=.*/m,
|
||||
"WEBI_PKG_FILE='" + pkgFile + "'"
|
||||
"WEBI_PKG_FILE='" + pkgFile + "'",
|
||||
)
|
||||
// PKG details
|
||||
.replace(/^\s*#?PKG_NAME=.*/m, "PKG_NAME='" + pkg + "'")
|
||||
.replace(
|
||||
/^\s*#?PKG_OSES=.*/m,
|
||||
"PKG_OSES='" + ((rel && rel.oses) || []).join(',') + "'"
|
||||
"PKG_OSES='" + ((rel && rel.oses) || []).join(',') + "'",
|
||||
)
|
||||
.replace(
|
||||
/^\s*#?PKG_ARCHES=.*/m,
|
||||
"PKG_ARCHES='" + ((rel && rel.arches) || []).join(',') + "'"
|
||||
"PKG_ARCHES='" + ((rel && rel.arches) || []).join(',') + "'",
|
||||
)
|
||||
.replace(
|
||||
/^\s*#?PKG_FORMATS=.*/m,
|
||||
"PKG_FORMATS='" + ((rel && rel.formats) || []).join(',') + "'"
|
||||
"PKG_FORMATS='" + ((rel && rel.formats) || []).join(',') + "'",
|
||||
)
|
||||
// $', $0, ... $9, $`, $&, and $_ all have special meaning
|
||||
// (see https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp)
|
||||
@@ -156,7 +156,7 @@ Releases.renderBash = function (
|
||||
Releases.renderBatch = function (
|
||||
pkgdir,
|
||||
rel,
|
||||
{ baseurl, pkg, tag, ver, os, arch, formats }
|
||||
{ baseurl, pkg, tag, ver, os, arch, formats },
|
||||
) {
|
||||
if (!Array.isArray(formats)) {
|
||||
formats = [];
|
||||
@@ -186,7 +186,7 @@ Releases.renderBatch = function (
|
||||
return tplTxt
|
||||
.replace(
|
||||
/^(REM )?WEBI_PKG=.*/im,
|
||||
"WEBI_PKG='" + pkg + '@' + ver + "'"
|
||||
"WEBI_PKG='" + pkg + '@' + ver + "'",
|
||||
)
|
||||
.replace(reInstallTpl, '\n' + installTxt);
|
||||
});
|
||||
@@ -196,7 +196,7 @@ Releases.renderBatch = function (
|
||||
Releases.renderPowerShell = function (
|
||||
pkgdir,
|
||||
rel,
|
||||
{ baseurl, pkg, tag, ver, os, arch, formats }
|
||||
{ baseurl, pkg, tag, ver, os, arch, formats },
|
||||
) {
|
||||
if (!Array.isArray(formats)) {
|
||||
formats = [];
|
||||
@@ -227,27 +227,27 @@ Releases.renderPowerShell = function (
|
||||
return tplTxt
|
||||
.replace(
|
||||
/^(#)?\$Env:WEBI_HOST\s*=.*/im,
|
||||
"$Env:WEBI_HOST = '" + baseurl + "'"
|
||||
"$Env:WEBI_HOST = '" + baseurl + "'",
|
||||
)
|
||||
.replace(
|
||||
/^(#)?\$Env:WEBI_PKG\s*=.*/im,
|
||||
"$Env:WEBI_PKG = '" + pkgver + "'"
|
||||
"$Env:WEBI_PKG = '" + pkgver + "'",
|
||||
)
|
||||
.replace(
|
||||
/^(#)?\$Env:PKG_NAME\s*=.*/im,
|
||||
"$Env:PKG_NAME = '" + pkg + "'"
|
||||
"$Env:PKG_NAME = '" + pkg + "'",
|
||||
)
|
||||
.replace(
|
||||
/^(#)?\$Env:WEBI_VERSION\s*=.*/im,
|
||||
"$Env:WEBI_VERSION = '" + rel.version + "'"
|
||||
"$Env:WEBI_VERSION = '" + rel.version + "'",
|
||||
)
|
||||
.replace(
|
||||
/^(#)?\$Env:WEBI_PKG_URL\s*=.*/im,
|
||||
"$Env:WEBI_PKG_URL = '" + rel.download + "'"
|
||||
"$Env:WEBI_PKG_URL = '" + rel.download + "'",
|
||||
)
|
||||
.replace(
|
||||
/^(#)?\$Env:WEBI_PKG_FILE\s*=.*/im,
|
||||
"$Env:WEBI_PKG_FILE = '" + rel.name + "'"
|
||||
"$Env:WEBI_PKG_FILE = '" + rel.name + "'",
|
||||
)
|
||||
.replace(reInstallTpl, '\n' + installTxt);
|
||||
});
|
||||
|
||||
@@ -17,7 +17,7 @@ module.exports = async function serveInstaller(
|
||||
pkg,
|
||||
tag,
|
||||
ext,
|
||||
formats
|
||||
formats,
|
||||
) {
|
||||
// TODO put some of this in a middleware? or common function?
|
||||
|
||||
@@ -61,7 +61,7 @@ module.exports = async function serveInstaller(
|
||||
lts,
|
||||
channel,
|
||||
formats,
|
||||
limit: 1
|
||||
limit: 1,
|
||||
}).then(function (rels) {
|
||||
var rel = rels.releases[0];
|
||||
var pkgdir = path.join(installersDir, pkg);
|
||||
@@ -75,7 +75,7 @@ module.exports = async function serveInstaller(
|
||||
lts,
|
||||
channel,
|
||||
formats,
|
||||
limit: 1
|
||||
limit: 1,
|
||||
};
|
||||
rel.oses = rels.oses;
|
||||
rel.arches = rels.arches;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
//
|
||||
var usage = [
|
||||
'Usage: node _webi/test.js --debug <path-to-package>',
|
||||
'Example: node _webi/test.js --debug ./node/'
|
||||
'Example: node _webi/test.js --debug ./node/',
|
||||
].join('\n');
|
||||
|
||||
var count = 3;
|
||||
@@ -104,7 +104,7 @@ Releases.get(path.join(process.cwd(), pkgdir)).then(function (all) {
|
||||
ver: '',
|
||||
os: osrel,
|
||||
arch,
|
||||
formats: formats
|
||||
formats: formats,
|
||||
}).catch(function () {}),
|
||||
Releases.renderPowerShell(pkgdir, rel, {
|
||||
baseurl: 'https://webinstall.dev',
|
||||
@@ -113,8 +113,8 @@ Releases.get(path.join(process.cwd(), pkgdir)).then(function (all) {
|
||||
ver: '',
|
||||
os: osrel,
|
||||
arch,
|
||||
formats: formats
|
||||
}).catch(function () {})
|
||||
formats: formats,
|
||||
}).catch(function () {}),
|
||||
]).then(function (scripts) {
|
||||
var bashTxt = scripts[0];
|
||||
var ps1Txt = scripts[1];
|
||||
@@ -125,7 +125,7 @@ Releases.get(path.join(process.cwd(), pkgdir)).then(function (all) {
|
||||
bashTxt = (bashTxt || 'echo ERROR').replace(/#set -x/g, 'set -x');
|
||||
ps1Txt = (ps1Txt || 'echo ERROR').replace(
|
||||
/REM REM todo debug/g,
|
||||
'REM todo debug'
|
||||
'REM todo debug',
|
||||
);
|
||||
}
|
||||
console.info('Do the scripts actually work?');
|
||||
|
||||
@@ -83,7 +83,7 @@ async function getCachedReleases(pkg) {
|
||||
console.error(
|
||||
'Error fetching releases for "%s": %s',
|
||||
pkg,
|
||||
e.toString()
|
||||
e.toString(),
|
||||
);
|
||||
cache[pkg].all = { download: '', releases: [] };
|
||||
})
|
||||
@@ -99,7 +99,7 @@ async function getCachedReleases(pkg) {
|
||||
cache[pkg] = {
|
||||
updatedAt: 0,
|
||||
all: null,
|
||||
promise: Promise.resolve()
|
||||
promise: Promise.resolve(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ async function getCachedReleases(pkg) {
|
||||
|
||||
async function filterReleases(
|
||||
all,
|
||||
{ ver, os, arch, lts, channel, formats, limit }
|
||||
{ ver, os, arch, lts, channel, formats, limit },
|
||||
) {
|
||||
// When multiple formats are downloadable (i.e. .zip and .pkg)
|
||||
// sort the most compatible format first
|
||||
@@ -163,7 +163,7 @@ module.exports = function getReleases({
|
||||
lts,
|
||||
channel,
|
||||
formats,
|
||||
limit
|
||||
limit,
|
||||
}) {
|
||||
if (!_count) {
|
||||
_count = 0;
|
||||
@@ -176,14 +176,14 @@ module.exports = function getReleases({
|
||||
lts,
|
||||
channel,
|
||||
formats,
|
||||
limit
|
||||
limit,
|
||||
})
|
||||
.catch(function (err) {
|
||||
if ('MODULE_NOT_FOUND' === err.code) {
|
||||
return null;
|
||||
}
|
||||
console.error(
|
||||
'TODO: lib/release.js: check type of error, such as MODULE_NOT_FOUND'
|
||||
'TODO: lib/release.js: check type of error, such as MODULE_NOT_FOUND',
|
||||
);
|
||||
console.error(err);
|
||||
})
|
||||
@@ -199,7 +199,7 @@ module.exports = function getReleases({
|
||||
lts,
|
||||
channel,
|
||||
formats,
|
||||
limit
|
||||
limit,
|
||||
});
|
||||
}
|
||||
// Raspberry Pi 3+ on Raspbian x86 (not Ubuntu arm64)
|
||||
@@ -213,7 +213,7 @@ module.exports = function getReleases({
|
||||
lts,
|
||||
channel,
|
||||
formats,
|
||||
limit
|
||||
limit,
|
||||
});
|
||||
}
|
||||
// Raspberry Pi 3+ on Ubuntu arm64 (via Bionic?)
|
||||
@@ -228,7 +228,7 @@ module.exports = function getReleases({
|
||||
lts,
|
||||
channel,
|
||||
formats,
|
||||
limit
|
||||
limit,
|
||||
});
|
||||
}
|
||||
// Raspberry Pi 3+ on Ubuntu arm64 (via Bionic?)
|
||||
@@ -242,7 +242,7 @@ module.exports = function getReleases({
|
||||
lts,
|
||||
channel,
|
||||
formats,
|
||||
limit
|
||||
limit,
|
||||
});
|
||||
}
|
||||
releases = [
|
||||
@@ -260,15 +260,15 @@ module.exports = function getReleases({
|
||||
comment:
|
||||
'No matches found. Could be bad or missing version info' +
|
||||
',' +
|
||||
"Check query parameters. Should be something like '/api/releases/{package}@{version}.tab?os={macos|linux|windows|-}&arch={amd64|x86|aarch64|arm64|armv7l|-}&limit=100'"
|
||||
}
|
||||
"Check query parameters. Should be something like '/api/releases/{package}@{version}.tab?os={macos|linux|windows|-}&arch={amd64|x86|aarch64|arm64|armv7l|-}&limit=100'",
|
||||
},
|
||||
];
|
||||
}
|
||||
return {
|
||||
oses: all.oses,
|
||||
arches: all.arches,
|
||||
formats: all.formats,
|
||||
releases: releases
|
||||
releases: releases,
|
||||
};
|
||||
});
|
||||
});
|
||||
@@ -284,7 +284,7 @@ if (require.main === module) {
|
||||
lts: true,
|
||||
channel: 'stable',
|
||||
formats: ['tar', 'exe', 'zip', 'xz', 'dmg', 'pkg'],
|
||||
limit: 10
|
||||
limit: 10,
|
||||
})
|
||||
.then(function (all) {
|
||||
console.info(JSON.stringify(all));
|
||||
|
||||
@@ -20,7 +20,7 @@ function getRequest(req) {
|
||||
windows: 'curl.exe -fsSA "MS $Env:PROCESSOR_ARCHITECTURE" ' + url,
|
||||
ua: ua,
|
||||
os: uaDetect.os(ua),
|
||||
arch: uaDetect.arch(ua)
|
||||
arch: uaDetect.arch(ua),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -6,20 +6,20 @@ var matchers = {
|
||||
metaGeneration: /.*MetaGeneration>(.*)<\/MetaGeneration.*/,
|
||||
lastModified: /.*LastModified>(.*)<\/LastModified.*/,
|
||||
etag: /.*ETag>(.*)<\/ETag.*/,
|
||||
size: /.*Size>(.*)<\/Size.*/
|
||||
size: /.*Size>(.*)<\/Size.*/,
|
||||
};
|
||||
var baseUrl = 'https://chromedriver.storage.googleapis.com';
|
||||
|
||||
module.exports = function (request) {
|
||||
var all = {
|
||||
download: '',
|
||||
releases: []
|
||||
releases: [],
|
||||
};
|
||||
|
||||
// XML
|
||||
return request({
|
||||
url: 'https://chromedriver.storage.googleapis.com/',
|
||||
json: false
|
||||
json: false,
|
||||
})
|
||||
.then(function (resp) {
|
||||
var body = resp.body;
|
||||
@@ -32,7 +32,7 @@ module.exports = function (request) {
|
||||
key: group.replace(matchers.key, '$1'),
|
||||
//generation: group.replace(matchers.generation, '$1'),
|
||||
//metaGeneration: group.replace(matchers.metaGeneration, '$1'),
|
||||
lastModified: group.replace(matchers.lastModified, '$1')
|
||||
lastModified: group.replace(matchers.lastModified, '$1'),
|
||||
//etag: group.replace(matchers.etag, '$1'),
|
||||
//size: group.replace(matchers.size, '$1')
|
||||
};
|
||||
@@ -66,7 +66,7 @@ module.exports = function (request) {
|
||||
os: osname,
|
||||
arch: arch,
|
||||
hash: '-', // not sure about including etag as hash yet
|
||||
download: asset.key
|
||||
download: asset.key,
|
||||
});
|
||||
});
|
||||
})
|
||||
|
||||
@@ -12,7 +12,7 @@ module.exports = function (request) {
|
||||
'armv7l',
|
||||
'ppc64le',
|
||||
's390x',
|
||||
'x86'
|
||||
'x86',
|
||||
];
|
||||
let oses = ['freebsd', 'linux', 'macos', 'posix'];
|
||||
return githubSource(request, owner, repo, oses, arches).then(function (all) {
|
||||
|
||||
@@ -175,8 +175,8 @@ Hyper is configured with JavaScript.
|
||||
module.exports = {
|
||||
config: {
|
||||
// ...
|
||||
shell: process.env.HOME + '/.local/bin/fish'
|
||||
}
|
||||
shell: process.env.HOME + '/.local/bin/fish',
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ var map = {};
|
||||
module.exports = function (request) {
|
||||
var all = {
|
||||
download: '',
|
||||
releases: []
|
||||
releases: [],
|
||||
};
|
||||
return Promise.all(
|
||||
['macos', 'linux', 'windows'].map(function (osname) {
|
||||
@@ -14,7 +14,7 @@ module.exports = function (request) {
|
||||
'https://storage.googleapis.com/flutter_infra/releases/releases_' +
|
||||
osname +
|
||||
'.json',
|
||||
json: true
|
||||
json: true,
|
||||
}).then(function (resp) {
|
||||
var body = resp.body;
|
||||
all.download = body.base_url + '/{{ download }}';
|
||||
@@ -31,11 +31,11 @@ module.exports = function (request) {
|
||||
os: osname,
|
||||
arch: 'amd64',
|
||||
hash: '-', // not sure about including hash / sha256 yet
|
||||
download: asset.archive
|
||||
download: asset.archive,
|
||||
});
|
||||
});
|
||||
});
|
||||
})
|
||||
}),
|
||||
).then(function () {
|
||||
all.releases.sort(function (a, b) {
|
||||
if ('stable' === a.channel && a.channel !== b.channel) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
var osMap = {
|
||||
darwin: 'macos'
|
||||
darwin: 'macos',
|
||||
};
|
||||
var archMap = {
|
||||
386: 'x86'
|
||||
386: 'x86',
|
||||
};
|
||||
|
||||
function getAllReleases(request) {
|
||||
@@ -28,12 +28,12 @@ function getAllReleases(request) {
|
||||
*/
|
||||
return request({
|
||||
url: 'https://golang.org/dl/?mode=json&include=all',
|
||||
json: true
|
||||
json: true,
|
||||
}).then((resp) => {
|
||||
var goReleases = resp.body;
|
||||
var all = {
|
||||
releases: [],
|
||||
download: 'https://dl.google.com/go/{{ download }}'
|
||||
download: 'https://dl.google.com/go/{{ download }}',
|
||||
};
|
||||
|
||||
goReleases.forEach((release) => {
|
||||
@@ -58,7 +58,7 @@ function getAllReleases(request) {
|
||||
arch: arch,
|
||||
ext: '', // let normalize run the split/test/join
|
||||
hash: '-', // not ready to standardize this yet
|
||||
download: filename
|
||||
download: filename,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -5,14 +5,14 @@ let ltsRe = /GnuPG-(2\.2\.[\d\.]+)/;
|
||||
function createRssMatcher() {
|
||||
return new RegExp(
|
||||
'<link>(https://sourceforge\\.net/projects/gpgosx/files/GnuPG-([\\d\\.]+)\\.dmg/download)</link>',
|
||||
'g'
|
||||
'g',
|
||||
);
|
||||
}
|
||||
|
||||
function createUrlMatcher() {
|
||||
return new RegExp(
|
||||
'https://sourceforge\\.net/projects/gpgosx/files/(GnuPG-([\\d\\.]+)\\.dmg)/download',
|
||||
''
|
||||
'',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ async function getRawReleases(request) {
|
||||
let matcher = createRssMatcher();
|
||||
|
||||
let resp = await request({
|
||||
url: 'https://sourceforge.net/projects/gpgosx/rss?path=/'
|
||||
url: 'https://sourceforge.net/projects/gpgosx/rss?path=/',
|
||||
});
|
||||
let links = [];
|
||||
for (;;) {
|
||||
@@ -64,13 +64,13 @@ function transformReleases(links) {
|
||||
os: 'macos',
|
||||
arch: 'amd64',
|
||||
ext: 'dmg',
|
||||
download: link
|
||||
download: link,
|
||||
};
|
||||
})
|
||||
.filter(Boolean);
|
||||
|
||||
return {
|
||||
releases: releases
|
||||
releases: releases,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
function getRawReleases(request) {
|
||||
return request({ url: 'https://iterm2.com/downloads.html' }).then(function (
|
||||
resp
|
||||
resp,
|
||||
) {
|
||||
var links = resp.body
|
||||
.split(/[<>]+/g)
|
||||
@@ -40,10 +40,10 @@ function transformReleases(links) {
|
||||
os: 'macos',
|
||||
arch: 'amd64',
|
||||
ext: '', // let normalize run the split/test/join
|
||||
download: link
|
||||
download: link,
|
||||
};
|
||||
})
|
||||
.filter(Boolean)
|
||||
.filter(Boolean),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ Engineering_ (as opposed to just _Code Monkey_-ing around):
|
||||
strict: true,
|
||||
maxdepth: 4,
|
||||
maxstatements: 100,
|
||||
maxcomplexity: 20
|
||||
maxcomplexity: 20,
|
||||
}
|
||||
```
|
||||
|
||||
@@ -147,8 +147,8 @@ certain file patterns and directories.
|
||||
esversion: 11,
|
||||
overrides: {
|
||||
'./browser/*.js': {
|
||||
esversion: 7
|
||||
}
|
||||
}
|
||||
esversion: 7,
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@@ -6,7 +6,7 @@ var oses = [
|
||||
version: '10.12.6',
|
||||
date: '2018-09-26',
|
||||
channel: 'beta',
|
||||
url: 'https://support.apple.com/en-us/HT208202'
|
||||
url: 'https://support.apple.com/en-us/HT208202',
|
||||
},
|
||||
{
|
||||
name: 'OS X El Capitan',
|
||||
@@ -14,15 +14,15 @@ var oses = [
|
||||
date: '2018-07-09',
|
||||
lts: true,
|
||||
channel: 'stable',
|
||||
url: 'https://support.apple.com/en-us/HT206886'
|
||||
url: 'https://support.apple.com/en-us/HT206886',
|
||||
},
|
||||
{
|
||||
name: 'OS X Yosemite',
|
||||
version: '10.10.5',
|
||||
date: '2017-07-19',
|
||||
channel: 'beta',
|
||||
url: 'https://support.apple.com/en-us/HT210717'
|
||||
}
|
||||
url: 'https://support.apple.com/en-us/HT210717',
|
||||
},
|
||||
];
|
||||
|
||||
var headers = {
|
||||
@@ -37,7 +37,7 @@ var headers = {
|
||||
'Sec-Fetch-Site': 'none',
|
||||
'Sec-Fetch-Mode': 'navigate',
|
||||
'Sec-Fetch-User': '?1',
|
||||
'Accept-Language': 'en-US,en;q=0.9,sq;q=0.8'
|
||||
'Accept-Language': 'en-US,en;q=0.9,sq;q=0.8',
|
||||
};
|
||||
|
||||
module.exports = function (request) {
|
||||
@@ -48,7 +48,7 @@ module.exports = function (request) {
|
||||
return request({
|
||||
method: 'GET',
|
||||
url: os.url,
|
||||
headers: headers
|
||||
headers: headers,
|
||||
}).then(function (resp) {
|
||||
var m = resp.body.match(/(http[^>]+Install[^>]+.dmg)/);
|
||||
var download = m && m[1];
|
||||
@@ -62,11 +62,11 @@ module.exports = function (request) {
|
||||
arch: 'amd64',
|
||||
ext: 'dmg',
|
||||
hash: '-',
|
||||
download: download
|
||||
download: download,
|
||||
});
|
||||
});
|
||||
});
|
||||
})
|
||||
}),
|
||||
).then(function () {
|
||||
all.releases.sort(function (a, b) {
|
||||
if ('10.11.6' === a.version) {
|
||||
|
||||
@@ -41,8 +41,8 @@ module.exports = function (request) {
|
||||
download:
|
||||
'http://archive.mariadb.org/mariadb-{{ v }}/bintar-linux-x86_64/mariadb-{{ v }}-linux-x86_64.tar.gz'.replace(
|
||||
/{{ v }}/g,
|
||||
ver.version
|
||||
)
|
||||
ver.version,
|
||||
),
|
||||
});
|
||||
all.releases.push({
|
||||
version: ver.version,
|
||||
@@ -54,8 +54,8 @@ module.exports = function (request) {
|
||||
download:
|
||||
'http://archive.mariadb.org/mariadb-{{ v }}/bintar-linux-x86/mariadb-{{ v }}-linux-x86.tar.gz'.replace(
|
||||
/{{ v }}/g,
|
||||
ver.version
|
||||
)
|
||||
ver.version,
|
||||
),
|
||||
});
|
||||
|
||||
// windows
|
||||
@@ -69,8 +69,8 @@ module.exports = function (request) {
|
||||
download:
|
||||
'http://archive.mariadb.org/mariadb-{{ v }}/winx64-packages/mariadb-{{ v }}-winx64.zip'.replace(
|
||||
/{{ v }}/g,
|
||||
ver.version
|
||||
)
|
||||
ver.version,
|
||||
),
|
||||
});
|
||||
all.releases.push({
|
||||
version: ver.version,
|
||||
@@ -82,8 +82,8 @@ module.exports = function (request) {
|
||||
download:
|
||||
'http://archive.mariadb.org/mariadb-{{ v }}/win32-packages/mariadb-{{ v }}-win32.zip'.replace(
|
||||
/{{ v }}/g,
|
||||
ver.version
|
||||
)
|
||||
ver.version,
|
||||
),
|
||||
});
|
||||
|
||||
// Note: versions are sorted most-recent first.
|
||||
@@ -95,7 +95,7 @@ module.exports = function (request) {
|
||||
// 10.3 => ^10.2(\b|\.)
|
||||
var reBrewVer = new RegExp(
|
||||
'^' + brew.version.replace(/\./, '\\.') + '(\\b|\\.)',
|
||||
'g'
|
||||
'g',
|
||||
);
|
||||
if (!ver.version.match(reBrewVer)) {
|
||||
return;
|
||||
@@ -107,7 +107,7 @@ module.exports = function (request) {
|
||||
date: ver.date,
|
||||
os: 'macos',
|
||||
arch: 'amd64',
|
||||
download: brew.download.replace(/{{ v }}/g, ver.version)
|
||||
download: brew.download.replace(/{{ v }}/g, ver.version),
|
||||
});
|
||||
brews.splice(i, 1); // remove
|
||||
return true;
|
||||
@@ -120,7 +120,7 @@ module.exports = function (request) {
|
||||
function mariaReleases() {
|
||||
return request({
|
||||
url: 'https://downloads.mariadb.org/mariadb/+releases/',
|
||||
fail: true // https://git.coolaj86.com/coolaj86/request.js/issues/2
|
||||
fail: true, // https://git.coolaj86.com/coolaj86/request.js/issues/2
|
||||
})
|
||||
.then(failOnBadStatus)
|
||||
.then(function (resp) {
|
||||
@@ -159,7 +159,7 @@ module.exports = function (request) {
|
||||
return {
|
||||
version: m[1],
|
||||
channel: mapChannel(m[3].toLowerCase()),
|
||||
date: m[2]
|
||||
date: m[2],
|
||||
};
|
||||
})
|
||||
.filter(Boolean);
|
||||
@@ -203,8 +203,8 @@ if (module === require.main) {
|
||||
})
|
||||
.slice(0, 2),
|
||||
null,
|
||||
2
|
||||
)
|
||||
2,
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -23,18 +23,18 @@ var map = {
|
||||
msi: 'msi',
|
||||
'7z': '7z',
|
||||
zip: 'zip',
|
||||
tar: 'tar.gz'
|
||||
tar: 'tar.gz',
|
||||
};
|
||||
|
||||
function getAllReleases(request) {
|
||||
return request({
|
||||
url: 'https://nodejs.org/dist/index.json',
|
||||
json: true
|
||||
json: true,
|
||||
}).then(function (resp) {
|
||||
var rels = resp.body;
|
||||
var all = {
|
||||
releases: [],
|
||||
download: '' // node's download URLs are unpredictable
|
||||
download: '', // node's download URLs are unpredictable
|
||||
};
|
||||
|
||||
// https://blog.risingstack.com/update-nodejs-8-end-of-life-no-support/
|
||||
@@ -84,7 +84,7 @@ function getAllReleases(request) {
|
||||
// See https://nodejs.org/dist/v14.0.0/
|
||||
// usually like https://nodejs.org/dist/v14.0.0/node-{version}-{plat}-{arch}.{ext}
|
||||
download:
|
||||
'https://nodejs.org/dist/' + rel.version + '/node-' + rel.version
|
||||
'https://nodejs.org/dist/' + rel.version + '/node-' + rel.version,
|
||||
};
|
||||
all.releases.push(r);
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ module.exports = async function () {
|
||||
os: 'linux',
|
||||
arch: 'amd64',
|
||||
ext: 'tar',
|
||||
download: ''
|
||||
download: '',
|
||||
},
|
||||
{
|
||||
name: 'postgresql-10.12-1-linux-binaries.tar.gz',
|
||||
@@ -28,7 +28,7 @@ module.exports = async function () {
|
||||
os: 'linux',
|
||||
arch: 'x86',
|
||||
ext: 'tar',
|
||||
download: ''
|
||||
download: '',
|
||||
},
|
||||
{
|
||||
name: 'postgresql-10.12-1-osx-binaries.zip',
|
||||
@@ -39,7 +39,7 @@ module.exports = async function () {
|
||||
os: 'macos',
|
||||
arch: 'amd64',
|
||||
ext: 'zip',
|
||||
download: ''
|
||||
download: '',
|
||||
},
|
||||
{
|
||||
name: 'postgresql-10.13-1-osx-binaries.zip',
|
||||
@@ -50,7 +50,7 @@ module.exports = async function () {
|
||||
os: 'macos',
|
||||
arch: 'amd64',
|
||||
ext: 'zip',
|
||||
download: ''
|
||||
download: '',
|
||||
},
|
||||
{
|
||||
name: 'postgresql-11.8-1-osx-binaries.zip',
|
||||
@@ -61,7 +61,7 @@ module.exports = async function () {
|
||||
os: 'macos',
|
||||
arch: 'amd64',
|
||||
ext: 'zip',
|
||||
download: ''
|
||||
download: '',
|
||||
},
|
||||
{
|
||||
name: 'postgresql-12.3-1-osx-binaries.zip',
|
||||
@@ -72,8 +72,8 @@ module.exports = async function () {
|
||||
os: 'macos',
|
||||
arch: 'amd64',
|
||||
ext: 'zip',
|
||||
download: ''
|
||||
}
|
||||
download: '',
|
||||
},
|
||||
].map(function (rel) {
|
||||
rel.download =
|
||||
'https://get.enterprisedb.com/postgresql/' +
|
||||
@@ -81,7 +81,7 @@ module.exports = async function () {
|
||||
'?ls=Crossover&type=Crossover';
|
||||
return rel;
|
||||
}),
|
||||
download: ''
|
||||
download: '',
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ module.exports = async function () {
|
||||
os: 'linux',
|
||||
arch: 'amd64',
|
||||
ext: 'tar',
|
||||
download: ''
|
||||
download: '',
|
||||
},
|
||||
{
|
||||
name: 'webi.tar',
|
||||
@@ -23,7 +23,7 @@ module.exports = async function () {
|
||||
os: 'macos',
|
||||
arch: 'amd64',
|
||||
ext: 'tar',
|
||||
download: ''
|
||||
download: '',
|
||||
},
|
||||
{
|
||||
name: 'webi.tar',
|
||||
@@ -34,10 +34,10 @@ module.exports = async function () {
|
||||
os: 'windows',
|
||||
arch: 'amd64',
|
||||
ext: 'tar',
|
||||
download: ''
|
||||
}
|
||||
download: '',
|
||||
},
|
||||
],
|
||||
formats: [],
|
||||
downloads: ''
|
||||
downloads: '',
|
||||
};
|
||||
};
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
module.exports = function (request) {
|
||||
return request({
|
||||
url: 'https://ziglang.org/download/index.json',
|
||||
json: true
|
||||
json: true,
|
||||
}).then(function (resp) {
|
||||
let versions = resp.body;
|
||||
let releases = [];
|
||||
@@ -30,7 +30,7 @@ module.exports = function (request) {
|
||||
let os = parts[1];
|
||||
if (parts.length > 2) {
|
||||
console.warn(
|
||||
`unexpected platform name with multiple '-': ${platform}`
|
||||
`unexpected platform name with multiple '-': ${platform}`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -45,7 +45,7 @@ module.exports = function (request) {
|
||||
//arch: arch,
|
||||
download: pkg.tarball,
|
||||
hash: pkg.shasum,
|
||||
size: pkg.size
|
||||
size: pkg.size,
|
||||
// TODO docs + release notes?
|
||||
//docs: 'https://ziglang.org/documentation/0.9.1/',
|
||||
//stdDocs: 'https://ziglang.org/documentation/0.9.1/std/',
|
||||
@@ -66,7 +66,7 @@ module.exports = function (request) {
|
||||
});
|
||||
|
||||
return {
|
||||
releases: releases
|
||||
releases: releases,
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user