pull/3668/head^2
filip mertens 2 years ago
parent c848208ed3
commit 36d8f10e5e
  1. 15
      apps/remix-ide/ci/download_e2e_assets.js
  2. 19
      apps/remix-ide/ci/downloadsoljson.sh
  3. 26
      apps/remix-ide/webpack.config.js

@ -1,7 +1,6 @@
const fs = require('fs');
var child_process = require('child_process');
const axios = require('axios');
const { exit } = require('process');
var child = child_process.spawnSync('grep', ['-ir', '"soljson-v[0-9]"', 'libs/*', 'apps/*'], { encoding: 'utf8', cwd: process.cwd(), shell: true });
@ -38,18 +37,8 @@ if (soljson) {
if (!exists) {
console.log(url)
try {
axios({
method: 'get',
url: url,
}).then(function (response) {
fs.writeFile(path, response.data, function (err) {
if (err) {
console.log(err);
}
})
}).catch(function (error) {
console.log(error);
})
// use curl to download the file
child_process.exec(`curl -o ${path} ${url}`, { encoding: 'utf8', cwd: process.cwd(), shell: true })
} catch (e) {
console.log('Failed to download soljson' + version + ' from ' + url)
}

@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -e
# download https://binaries.soliditylang.org/wasm/list.json as json
curl https://binaries.soliditylang.org/wasm/list.json > list.json
# get the latest version
version=$(cat list.json | jq -r '.latestRelease')
echo $version
# the value of releases with key $version
url=$(cat list.json | npx jq -r '.releases[]' | grep $version)
echo $url
# set path to the url
path="https://binaries.soliditylang.org/bin/$url"
echo $path
# download the file to ./apps/remix-ide/src/assets/js/soljson.js
curl $path > ./apps/remix-ide/src/assets/js/soljson.js
# remove list.json
rm list.json

@ -15,30 +15,8 @@ const versionData = {
}
const loadLocalSolJson = async () => {
let url = 'https://binaries.soliditylang.org/wasm/list.json'
axios({
url: url,
method: 'GET',
}).then((response) => {
let info = response.data;
info.builds = info.builds.filter(build => build.path.indexOf('nightly') === -1)
info.builds = info.builds.slice(-1)
const buildurl = `https://binaries.soliditylang.org/bin/${info.builds[0].path}`
console.log(`Copying... ${buildurl} to assets`)
const path = `./apps/remix-ide/src/assets/js/soljson.js`;
axios({
method: 'get',
url: buildurl,
responseType: 'stream'
}).then((response) => {
response.data.pipe(fs.createWriteStream(path));
}).catch((error) => {
console.log(error.message)
})
}
).catch((error) => {
console.log(error.message)
})
// execute apps/remix-ide/ci/downloadsoljson.sh
const child = require('child_process').execSync('bash ./apps/remix-ide/ci/downloadsoljson.sh', { encoding: 'utf8', cwd: process.cwd(), shell: true })
}
fs.writeFileSync('./apps/remix-ide/src/assets/version.json', JSON.stringify(versionData))

Loading…
Cancel
Save