|
|
@ -1,9 +1,11 @@ |
|
|
|
const testFolder = './apps/remix-ide-e2e/src/tests/'; |
|
|
|
const testFolder = './apps/remix-ide-e2e/src/tests/'; |
|
|
|
const fs = require('fs'); |
|
|
|
const fs = require('fs'); |
|
|
|
|
|
|
|
var child_process = require('child_process'); |
|
|
|
|
|
|
|
|
|
|
|
let url = 'https://binaries.soliditylang.org/wasm/list.json' |
|
|
|
let url = 'https://binaries.soliditylang.org/wasm/list.json' |
|
|
|
|
|
|
|
|
|
|
|
const axios = require('axios') |
|
|
|
const axios = require('axios'); |
|
|
|
|
|
|
|
const { exit } = require('process'); |
|
|
|
|
|
|
|
|
|
|
|
// use axios to download the file
|
|
|
|
// use axios to download the file
|
|
|
|
/* |
|
|
|
/* |
|
|
@ -41,6 +43,51 @@ axios({ |
|
|
|
) |
|
|
|
) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var child = child_process.spawnSync('grep', ['-ir', '"\soljson-v0"', 'libs/*', 'apps/*'], { encoding: 'utf8', cwd: process.cwd(), shell: true }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (child.error) { |
|
|
|
|
|
|
|
console.log("ERROR: ", child); |
|
|
|
|
|
|
|
exit(1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const re = /(?<=soljson).*(?=(.js))/g; |
|
|
|
|
|
|
|
const soljson = child.stdout.match(re); |
|
|
|
|
|
|
|
if (soljson) { |
|
|
|
|
|
|
|
for (let i = 0; i < soljson.length; i++) { |
|
|
|
|
|
|
|
const version = soljson[i]; |
|
|
|
|
|
|
|
if (version) { |
|
|
|
|
|
|
|
let url = '' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
|
|
|
|
fs.readdirSync(testFolder).forEach(file => { |
|
|
|
fs.readdirSync(testFolder).forEach(file => { |
|
|
|
let c = fs.readFileSync(testFolder + file, 'utf8'); |
|
|
|
let c = fs.readFileSync(testFolder + file, 'utf8'); |
|
|
|
const re = /(?<=soljson).*(?=(.js))/g; |
|
|
|
const re = /(?<=soljson).*(?=(.js))/g; |
|
|
@ -78,3 +125,5 @@ fs.readdirSync(testFolder).forEach(file => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
|
|