|
|
|
@ -10,25 +10,35 @@ if (child.error) { |
|
|
|
|
exit(1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const re = /(?<=soljson).*(?=(.js))/g; |
|
|
|
|
let soljson = child.stdout.match(re); |
|
|
|
|
const nonnightlyre = /v\d*\.\d*\.\d*\+commit\.[\d\w]*/g; |
|
|
|
|
|
|
|
|
|
const re2 = /(?<=soljson).*(?=(\'))/g; |
|
|
|
|
let soljson2 = child.stdout.match(re2); |
|
|
|
|
soljson2 = soljson2.filter((item, index) => !item.includes('.js')); |
|
|
|
|
let soljson = child.stdout.match(nonnightlyre); |
|
|
|
|
console.log('non nightly soljson versions found: ', soljson); |
|
|
|
|
|
|
|
|
|
// merge the two arrays
|
|
|
|
|
const quotedversionre = /\'\d*\.\d*\.\d*\+commit\.[\d\w]*/g; |
|
|
|
|
let soljson2 = child.stdout.match(quotedversionre).map((item) => item.replace('\'', 'v')); |
|
|
|
|
console.log('quoted soljson versions found: ', soljson2); |
|
|
|
|
|
|
|
|
|
const nightlyversions = /\d*\.\d*\.\d-nightly.*\+commit\.[\d\w]*/g |
|
|
|
|
let soljson3 = child.stdout.match(nightlyversions).map((item) => 'v' + item); |
|
|
|
|
console.log('nightly soljson versions found: ', soljson3); |
|
|
|
|
|
|
|
|
|
// merge the three arrays
|
|
|
|
|
soljson = soljson.concat(soljson2); |
|
|
|
|
soljson = soljson.concat(soljson3); |
|
|
|
|
|
|
|
|
|
console.log('soljson versions found: ', soljson); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (soljson) { |
|
|
|
|
// filter out duplicates
|
|
|
|
|
//soljson = soljson.filter((item, index) => soljson.indexOf(item) === index);
|
|
|
|
|
soljson = soljson.filter((item, index) => soljson.indexOf(item) === index); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// manually add some versions
|
|
|
|
|
soljson.push('-v0.6.8+commit.0bbfe453'); |
|
|
|
|
soljson.push('-v0.6.0+commit.26b70077'); |
|
|
|
|
soljson.push('-v0.7.6+commit.7338295f'); |
|
|
|
|
|
|
|
|
|
soljson.push('v0.7.6+commit.7338295f'); |
|
|
|
|
|
|
|
|
|
console.log('soljson versions found: ', soljson); |
|
|
|
|
|
|
|
|
@ -39,9 +49,9 @@ if (soljson) { |
|
|
|
|
|
|
|
|
|
// if nightly
|
|
|
|
|
if (version.includes('nightly')) { |
|
|
|
|
url = `https://binaries.soliditylang.org/bin/soljson${version}.js`; |
|
|
|
|
url = `https://binaries.soliditylang.org/bin/soljson-${version}.js`; |
|
|
|
|
}else{ |
|
|
|
|
url = `https://binaries.soliditylang.org/wasm/soljson${version}.js`; |
|
|
|
|
url = `https://binaries.soliditylang.org/wasm/soljson-${version}.js`; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const dir = './dist/apps/remix-ide/assets/js/soljson'; |
|
|
|
@ -49,7 +59,7 @@ if (soljson) { |
|
|
|
|
fs.mkdirSync(dir); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const path = `./dist/apps/remix-ide/assets/js/soljson/soljson${version}.js`; |
|
|
|
|
const path = `./dist/apps/remix-ide/assets/js/soljson/soljson-${version}.js`; |
|
|
|
|
// check if the file exists
|
|
|
|
|
const exists = fs.existsSync(path); |
|
|
|
|
if (!exists) { |
|
|
|
|