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;
24 console.log('a', asset.channel);
28 version: asset.version.replace(/v/, ''),
30 channel: asset.channel,
31 date: asset.release_date.replace(/T.*/, ''),
34 hash: '-', // not sure about including hash / sha256 yet
35 download: asset.archive
41 all.releases.sort(function (a, b) {
42 if ('stable' === a.channel && a.channel !== b.channel) {
45 if ('stable' === b.channel && a.channel !== b.channel) {
48 if ('beta' === a.channel && a.channel !== b.channel) {
51 if ('beta' === b.channel && a.channel !== b.channel) {
54 return new Date(b.date).valueOf() - new Date(a.date).valueOf();
60 if (module === require.main) {
61 module.exports(require('@root/request')).then(function (all) {
62 all.releases = all.releases.slice(25);
63 console.log(JSON.stringify(all, null, 2));