optimize script

pull/3667/head
filip mertens 2 years ago
parent ecd04d27c0
commit d1a60178b6
  1. 20
      apps/remix-ide/ci/download_e2e_assets.js

@ -9,16 +9,14 @@ if (child.error) {
exit(1); exit(1);
} }
const nonNightlyRegex = /v\d*\.\d*\.\d*\+commit\.[\d\w]*/g;
let soljson = child.stdout.match(nonNightlyRegex) || []; let soljson =[];
console.log('non nightly soljson versions found: ', soljson);
const quotedVersionsRegex = /['"]\d*\.\d*\.\d*\+commit\.[\d\w]*/g; const quotedVersionsRegex = /['"v]\d*\.\d*\.\d*\+commit\.[\d\w]*/g;
let quotedVersionsRegexMatch = child.stdout.match(quotedVersionsRegex) let quotedVersionsRegexMatch = child.stdout.match(quotedVersionsRegex)
if(quotedVersionsRegexMatch){ if(quotedVersionsRegexMatch){
let soljson2 = quotedVersionsRegexMatch.map((item) => item.replace('\'', 'v').replace('"', 'v')) let soljson2 = quotedVersionsRegexMatch.map((item) => item.replace('\'', 'v').replace('"', 'v'))
console.log('quoted soljson versions found: ', soljson2); console.log('non nightly soljson versions found: ', soljson2);
if(soljson2) soljson = soljson.concat(soljson2); if(soljson2) soljson = soljson.concat(soljson2);
} }
@ -31,24 +29,14 @@ if(nightlyVersionsRegexMatch){
if(soljson3) soljson = soljson.concat(soljson3); if(soljson3) soljson = soljson.concat(soljson3);
} }
// merge the three arrays
console.log('soljson versions found: ', soljson);
if (soljson) { if (soljson) {
// filter out duplicates // 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 // manually add some versions
soljson.push('v0.7.6+commit.7338295f'); soljson.push('v0.7.6+commit.7338295f');
console.log('soljson versions found: ', soljson); console.log('soljson versions found: ', soljson, soljson.length);
for (let i = 0; i < soljson.length; i++) { for (let i = 0; i < soljson.length; i++) {
const version = soljson[i]; const version = soljson[i];

Loading…
Cancel
Save