pull/3668/head^2
filip mertens 2 years ago
parent 5745504e92
commit c5c61d1c27
  1. 93
      apps/remix-ide/ci/download_e2e_assets.js

@ -1,50 +1,9 @@
const testFolder = './apps/remix-ide-e2e/src/tests/';
const fs = require('fs'); const fs = require('fs');
var child_process = require('child_process'); var child_process = require('child_process');
let url = 'https://binaries.soliditylang.org/wasm/list.json'
const axios = require('axios'); const axios = require('axios');
const { exit } = require('process'); const { exit } = require('process');
// 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) {
const buildurl = `https://solc-bin.ethereum.org/wasm/${build.path}`;
console.log(buildurl)
const path = `./dist/apps/remix-ide/assets/js/${build.path}`;
// use axios to get the file
try {
axios({
method: 'get',
url: buildurl,
}).then(function (response) {
fs.writeFile(path, response.data, function (err) {
if (err) {
console.log(err);
}
})
})
} catch (e) {
console.log('Failed to download ' + build.path + ' from ' + buildurl)
}
}
}
)
*/
var child = child_process.spawnSync('grep', ['-ir', '"\soljson-v0"', 'libs/*', 'apps/*'], { encoding: 'utf8', cwd: process.cwd(), shell: true }); var child = child_process.spawnSync('grep', ['-ir', '"\soljson-v0"', 'libs/*', 'apps/*'], { encoding: 'utf8', cwd: process.cwd(), shell: true });
if (child.error) { if (child.error) {
@ -62,46 +21,12 @@ if (soljson) {
let url = '' let url = ''
url = `https://binaries.soliditylang.org/bin/soljson${version}.js`; url = `https://binaries.soliditylang.org/bin/soljson${version}.js`;
console.log(url)
const path = `./dist/apps/remix-ide/assets/js/soljson${version}.js`;
// use axios to get the file
try {
axios({
method: 'get',
url: url,
}).then(function (response) {
fs.writeFile(path, response.data, function (err) {
if (err) {
console.log(err);
}
})
})
} catch (e) {
console.log('Failed to download soljson' + version + ' from ' + url)
}
const path = `./dist/apps/remix-ide/assets/js/soljson${version}.js`;
} // check if the file exists
const exists = fs.existsSync(path);
} if (!exists) {
}
/*
fs.readdirSync(testFolder).forEach(file => {
let c = fs.readFileSync(testFolder + file, 'utf8');
const re = /(?<=soljson).*(?=(.js))/g;
const soljson = c.match(re);
if (soljson) {
console.log(soljson)
for (let i = 0; i < soljson.length; i++) {
const version = soljson[i];
if (version) {
const url = `https://solc-bin.ethereum.org/bin/soljson${version}.js`;
console.log(url) console.log(url)
const path = `./dist/apps/remix-ide/assets/js/soljson${version}.js`;
// use axios to get the file // use axios to get the file
try { try {
axios({ axios({
@ -117,13 +42,11 @@ fs.readdirSync(testFolder).forEach(file => {
} catch (e) { } catch (e) {
console.log('Failed to download soljson' + version + ' from ' + url) console.log('Failed to download soljson' + version + ' from ' + url)
} }
} }
} }
}
}); }
}
*/

Loading…
Cancel
Save