5 module.exports = function (request) {
11 ['macos', 'linux', 'windows'].map(function (osname) {
14 'https://storage.googleapis.com/flutter_infra/releases/releases_' +
18 }).then(function (resp) {
20 all.download = body.base_url + '/{{ download }}';
21 body.releases.forEach(function (asset) {
22 if (!map[asset.channel]) {
23 map[asset.channel] = true;
27 version: asset.version.replace(/v/, ''),
29 channel: asset.channel,
30 date: asset.release_date.replace(/T.*/, ''),
33 hash: '-', // not sure about including hash / sha256 yet
34 download: asset.archive
40 all.releases.sort(function (a, b) {
41 if ('stable' === a.channel && a.channel !== b.channel) {
44 if ('stable' === b.channel && a.channel !== b.channel) {
47 if ('beta' === a.channel && a.channel !== b.channel) {
50 if ('beta' === b.channel && a.channel !== b.channel) {
53 return new Date(b.date).valueOf() - new Date(a.date).valueOf();
59 if (module === require.main) {
60 module.exports(require('@root/request')).then(function (all) {
61 all.releases = all.releases.slice(25);
62 console.info(JSON.stringify(all, null, 2));