From 743f1bf065efc676508b2a03bfca7569d72084d3 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Tue, 20 Sep 2022 12:24:07 +0200 Subject: [PATCH] download auto --- apps/remix-ide/ci/download_e2e_assets.js | 28 ++++++++++++++++++++++++ apps/remix-ide/ci/download_e2e_assets.sh | 15 ------------- package.json | 2 +- 3 files changed, 29 insertions(+), 16 deletions(-) create mode 100644 apps/remix-ide/ci/download_e2e_assets.js delete mode 100644 apps/remix-ide/ci/download_e2e_assets.sh diff --git a/apps/remix-ide/ci/download_e2e_assets.js b/apps/remix-ide/ci/download_e2e_assets.js new file mode 100644 index 0000000000..412309cd9b --- /dev/null +++ b/apps/remix-ide/ci/download_e2e_assets.js @@ -0,0 +1,28 @@ +const testFolder = './apps/remix-ide-e2e/src/tests/'; +const fs = require('fs'); + + + +fs.readdirSync(testFolder).forEach(file => { + let c = fs.readFileSync(testFolder + file, 'utf8'); + const re = /(?<=soljson).*(?=(.js))/g; + const soljson = c.match(re); + if (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) + + const path = `./dist/apps/remix-ide/assets/js/soljson${version}.js`; + const file = fs.createWriteStream(path); + require('https').get(url, function (response) { + response.pipe(file); + }); + } + + } + } + +}); \ No newline at end of file diff --git a/apps/remix-ide/ci/download_e2e_assets.sh b/apps/remix-ide/ci/download_e2e_assets.sh deleted file mode 100644 index 94d8fc3dfe..0000000000 --- a/apps/remix-ide/ci/download_e2e_assets.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -set -e - -wget --no-check-certificate https://binaries.soliditylang.org/bin/soljson-v0.8.7+commit.e28d00a7.js -O ./dist/apps/remix-ide/assets/js/soljson-v0.8.7+commit.e28d00a7.js -wget --no-check-certificate https://binaries.soliditylang.org/bin/soljson-v0.8.16+commit.07a7930e.js -O ./dist/apps/remix-ide/assets/js/soljson-v0.8.16+commit.07a7930e.js -wget --no-check-certificate https://binaries.soliditylang.org/bin/soljson-v0.8.15+commit.e14f2714.js -O ./dist/apps/remix-ide/assets/js/soljson-v0.8.15+commit.e14f2714.js -wget --no-check-certificate https://binaries.soliditylang.org/bin/soljson-v0.7.4+commit.3f05b770.js -O ./dist/apps/remix-ide/assets/js/soljson-v0.7.4+commit.3f05b770.js -wget --no-check-certificate https://binaries.soliditylang.org/bin/soljson-v0.4.14+commit.c2215d46.js -O ./dist/apps/remix-ide/assets/js/soljson-v0.4.14+commit.c2215d46.js -wget --no-check-certificate https://binaries.soliditylang.org/bin/soljson-v0.6.8+commit.0bbfe453.js -O ./dist/apps/remix-ide/assets/js/soljson-v0.6.8+commit.0bbfe453.js -wget --no-check-certificate https://binaries.soliditylang.org/bin/soljson-v0.8.1+commit.df193b15.js -O ./dist/apps/remix-ide/assets/js/soljson-v0.8.1+commit.df193b15.js -wget --no-check-certificate https://binaries.soliditylang.org/bin/soljson-v0.6.5+commit.f956cc89.js -O ./dist/apps/remix-ide/assets/js/soljson-v0.6.5+commit.f956cc89.js -wget --no-check-certificate https://binaries.soliditylang.org/bin/soljson-v0.6.8-nightly.2020.5.14+commit.a6d0067b.js -O ./dist/apps/remix-ide/assets/js/soljson-v0.6.8-nightly.2020.5.14+commit.a6d0067b.js -wget --no-check-certificate https://binaries.soliditylang.org/bin/soljson-v0.6.0-nightly.2019.12.17+commit.d13438ee.js -O ./dist/apps/remix-ide/assets/js/soljson-v0.6.0-nightly.2019.12.17+commit.d13438ee.js -wget --no-check-certificate https://binaries.soliditylang.org/bin/soljson-v0.6.12+commit.27d51765.js -O ./dist/apps/remix-ide/assets/js/soljson-v0.6.12+commit.27d51765.js diff --git a/package.json b/package.json index 68433bc40a..7185ab9b01 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "bumpVersion:libs": "gulp & gulp syncLibVersions;", "browsertest": "sleep 5 && yarn run nightwatch_local", "csslint": "csslint --ignore=order-alphabetical --errors='errors,duplicate-properties,empty-rules' --exclude-list='apps/remix-ide/src/assets/css/font-awesome.min.css' apps/remix-ide/src/assets/css/", - "downloadsolc_assets_e2e": "sh ./apps/remix-ide/ci/download_e2e_assets.sh", + "downloadsolc_assets_e2e": "node ./apps/remix-ide/ci/download_e2e_assets.js", "downloadsolc_assets": "wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.7+commit.e28d00a7.js -O ./apps/remix-ide/src/assets/js/soljson.js && wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.7+commit.e28d00a7.js -O ./apps/solidity-compiler/src/assets/js/soljson.js", "downloadsolc_assets_dist": "wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.7+commit.e28d00a7.js -O ./dist/apps/remix-ide/assets/js/soljson.js && wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.7+commit.e28d00a7.js -O ./dist/apps/solidity-compiler/assets/js/soljson.js", "make-mock-compiler": "node apps/remix-ide/ci/makeMockCompiler.js",