mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-08-23 22:16:48 +00:00
add version info to deno downloads
This commit is contained in:
+2
-1
@@ -42,6 +42,7 @@ Releases.renderBash = function (
|
||||
.replace(/[^+\-]*/, '')
|
||||
.replace(/^-/, '')
|
||||
};
|
||||
var pkgFile = rel.filename || rel.name;
|
||||
return fs.promises
|
||||
.readFile(path.join(__dirname, 'template.sh'), 'utf8')
|
||||
.then(function (tplTxt) {
|
||||
@@ -113,7 +114,7 @@ Releases.renderBash = function (
|
||||
)
|
||||
.replace(
|
||||
/^#?WEBI_PKG_FILE=.*/m,
|
||||
"WEBI_PKG_FILE='" + rel.name + "'"
|
||||
"WEBI_PKG_FILE='" + pkgFile + "'"
|
||||
)
|
||||
// PKG details
|
||||
.replace(/^#?PKG_NAME=.*/m, "PKG_NAME='" + pkg + "'")
|
||||
|
||||
+19
-4
@@ -1,5 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
var path = require('path');
|
||||
|
||||
var github = require('../_common/github.js');
|
||||
var owner = 'denoland';
|
||||
var repo = 'deno';
|
||||
@@ -7,9 +9,22 @@ var repo = 'deno';
|
||||
module.exports = function (request) {
|
||||
return github(request, owner, repo).then(function (all) {
|
||||
// remove checksums and .deb
|
||||
all.releases = all.releases.filter(function (rel) {
|
||||
return !/(\.txt)|(\.deb)$/i.test(rel.name);
|
||||
});
|
||||
all.releases = all.releases
|
||||
.filter(function (rel) {
|
||||
return !/(\.txt)|(\.deb)$/i.test(rel.name);
|
||||
})
|
||||
.map(function (rel) {
|
||||
var ext;
|
||||
if (!rel.name.match(rel.version)) {
|
||||
ext = path.extname(rel.name);
|
||||
rel.filename =
|
||||
rel.name.slice(0, rel.name.length - ext.length) +
|
||||
'-' +
|
||||
rel.version +
|
||||
ext;
|
||||
}
|
||||
return rel;
|
||||
});
|
||||
return all;
|
||||
});
|
||||
};
|
||||
@@ -17,6 +32,6 @@ module.exports = function (request) {
|
||||
if (module === require.main) {
|
||||
module.exports(require('@root/request')).then(function (all) {
|
||||
all = require('../_webi/normalize.js')(all);
|
||||
console.info(JSON.stringify(all));
|
||||
console.info(JSON.stringify(all, null, 2));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user