|
|
|
@ -2,10 +2,16 @@ const testFolder = './apps/remix-ide-e2e/src/tests/'; |
|
|
|
|
const fs = require('fs'); |
|
|
|
|
|
|
|
|
|
let url = 'https://binaries.soliditylang.org/wasm/list.json' |
|
|
|
|
let request = require('request'); |
|
|
|
|
request(url, function (error, response, body) { |
|
|
|
|
if (!error && response.statusCode == 200) { |
|
|
|
|
let info = JSON.parse(body); |
|
|
|
|
|
|
|
|
|
const axios = require('axios') |
|
|
|
|
|
|
|
|
|
// use axios to download the file
|
|
|
|
|
axios({ |
|
|
|
|
url: url, |
|
|
|
|
method: 'GET', |
|
|
|
|
}).then((response) => { |
|
|
|
|
|
|
|
|
|
let info = response.data; |
|
|
|
|
info.builds = info.builds.filter(build => build.path.indexOf('nightly') === -1) |
|
|
|
|
for (let build of info.builds) { |
|
|
|
|
|
|
|
|
@ -13,18 +19,19 @@ request(url, function (error, response, body) { |
|
|
|
|
console.log(buildurl) |
|
|
|
|
|
|
|
|
|
const path = `./dist/apps/remix-ide/assets/js/${build.path}`; |
|
|
|
|
const file = fs.createWriteStream(path); |
|
|
|
|
try { |
|
|
|
|
require('https').get(buildurl, function (response) { |
|
|
|
|
response.pipe(file); |
|
|
|
|
}); |
|
|
|
|
} catch (e) { |
|
|
|
|
console.log('error', buildurl) |
|
|
|
|
} |
|
|
|
|
// use axios to get the file
|
|
|
|
|
axios({ |
|
|
|
|
method: 'get', |
|
|
|
|
url: buildurl, |
|
|
|
|
responseType: 'stream' |
|
|
|
|
}).then(function (response) { |
|
|
|
|
// pipe the result stream into a file on disc
|
|
|
|
|
response.data.pipe(fs.createWriteStream(path)); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
fs.readdirSync(testFolder).forEach(file => { |
|
|
|
|
let c = fs.readFileSync(testFolder + file, 'utf8'); |
|
|
|
@ -39,10 +46,15 @@ fs.readdirSync(testFolder).forEach(file => { |
|
|
|
|
console.log(url) |
|
|
|
|
|
|
|
|
|
const path = `./dist/apps/remix-ide/assets/js/soljson${version}.js`; |
|
|
|
|
const file = fs.createWriteStream(path); |
|
|
|
|
require('https').get(url, function (response) { |
|
|
|
|
response.pipe(file); |
|
|
|
|
}); |
|
|
|
|
// use axios to get the file
|
|
|
|
|
axios({ |
|
|
|
|
method: 'get', |
|
|
|
|
url: url, |
|
|
|
|
responseType: 'stream' |
|
|
|
|
}).then(function (response) { |
|
|
|
|
// pipe the result stream into a file on disc
|
|
|
|
|
response.data.pipe(fs.createWriteStream(path)); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|