@assert-equals/dappdriver
Version:
DappDriver is an e2e testing framework designed for testing decentralized applications (dApps) using MetaMask, Rainbow or Zerion
24 lines (23 loc) • 1.15 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.zerion = void 0;
const constants_1 = require("../constants");
const log_1 = require("../log");
const install_1 = require("../wallet/install");
async function zerion(directory, version = constants_1.DEFAULT_ZERION_VERSION) {
try {
const assetName = `${constants_1.DEFAULT_ZERION_ASSET}-v${version}.zip`;
(0, install_1.compareVersion)(constants_1.ZERION, version, constants_1.RECOMMENDED_ZERION_VERSIONS);
const release = await (0, install_1.fetchGithubRelease)(constants_1.ZERION, version, constants_1.ZERION_GITHUB_API);
const asset = (0, install_1.findGithubAsset)(assetName, release);
(0, install_1.createDirectory)(directory);
const fileName = await (0, install_1.downloadAssetZipFile)(asset, directory);
const destDir = (0, install_1.extractZipContents)(fileName);
(0, install_1.moveFiles)(destDir);
(0, log_1.logSuccess)(`Installed Zerion version <v${version}>\n${destDir}`);
}
catch (error) {
(0, log_1.logError)(error.message);
}
}
exports.zerion = zerion;