Skip to content

Commit

Permalink
bump deps for release to rc36
Browse files Browse the repository at this point in the history
  • Loading branch information
truemiller committed Jun 4, 2024
1 parent 381b82a commit 993499b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 27 deletions.
54 changes: 29 additions & 25 deletions electron/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ const fs = require('fs');
const os = require('os');
const sudo = require('sudo-prompt');
const process = require('process');
const axios = require("axios")
const axios = require('axios');

const Docker = require('dockerode');
const { spawnSync } = require('child_process');

const Version = '0.1.0rc34';
const Version = '0.1.0rc36';
const OperateDirectory = `${os.homedir()}/.operate`;
const VenvDir = `${OperateDirectory}/venv`;
const TempDir = `${OperateDirectory}/temp`;
Expand All @@ -29,18 +29,21 @@ const SudoOptions = {
};
const TendermintUrls = {
darwin: {
x64: "https://github.com/tendermint/tendermint/releases/download/v0.34.19/tendermint_0.34.19_darwin_amd64.tar.gz",
arm64: "https://github.com/tendermint/tendermint/releases/download/v0.34.19/tendermint_0.34.19_darwin_arm64.tar.gz",
x64: 'https://github.com/tendermint/tendermint/releases/download/v0.34.19/tendermint_0.34.19_darwin_amd64.tar.gz',
arm64:
'https://github.com/tendermint/tendermint/releases/download/v0.34.19/tendermint_0.34.19_darwin_arm64.tar.gz',
},
linux: {
x64: "https://github.com/tendermint/tendermint/releases/download/v0.34.19/tendermint_0.34.19_linux_amd64.tar.gz",
arm64: "https://github.com/tendermint/tendermint/releases/download/v0.34.19/tendermint_0.34.19_linux_arm64.tar.gz",
x64: 'https://github.com/tendermint/tendermint/releases/download/v0.34.19/tendermint_0.34.19_linux_amd64.tar.gz',
arm64:
'https://github.com/tendermint/tendermint/releases/download/v0.34.19/tendermint_0.34.19_linux_arm64.tar.gz',
},
win32: {
x64: "https://github.com/tendermint/tendermint/releases/download/v0.34.19/tendermint_0.34.19_windows_amd64.tar.gz",
arm64: "https://github.com/tendermint/tendermint/releases/download/v0.34.19/tendermint_0.34.19_windows_arm64.tar.gz"
}
}
x64: 'https://github.com/tendermint/tendermint/releases/download/v0.34.19/tendermint_0.34.19_windows_amd64.tar.gz',
arm64:
'https://github.com/tendermint/tendermint/releases/download/v0.34.19/tendermint_0.34.19_windows_arm64.tar.gz',
},
};

function getBinPath(command) {
return spawnSync('/usr/bin/which', [command], { env: Env })
Expand Down Expand Up @@ -133,36 +136,37 @@ async function downloadFile(url, dest) {
const response = await axios({
url,
method: 'GET',
responseType: 'stream'
responseType: 'stream',
});
response.data.pipe(writer);
return new Promise((resolve, reject) => {
writer.on('finish', resolve);
writer.on('error', reject);
});
} catch (err) {
fs.unlink(dest, () => { }); // Delete the file if there is an error
fs.unlink(dest, () => {}); // Delete the file if there is an error
console.error('Error downloading the file:', err.message);
}
}

async function installTendermintUnix() {
const cwd = process.cwd()
process.chdir(TempDir)
const cwd = process.cwd();
process.chdir(TempDir);

console.log(appendLog(`Installing tendermint for ${os.platform()}-${process.arch}`))
const url = TendermintUrls[os.platform()][process.arch]
console.log(
appendLog(`Installing tendermint for ${os.platform()}-${process.arch}`),
);
const url = TendermintUrls[os.platform()][process.arch];

console.log(appendLog(`Downloading ${url}, might take a while...`))
await downloadFile(url, `${TempDir}/tendermint.tar.gz`)
console.log(appendLog(`Downloading ${url}, might take a while...`));
await downloadFile(url, `${TempDir}/tendermint.tar.gz`);

console.log(appendLog(`Installing tendermint binary`))
await runCmdUnix("tar", ["-xvf", "tendermint.tar.gz"])
await runSudoUnix("install", "tendermint /usr/local/bin")
process.chdir(cwd)
console.log(appendLog(`Installing tendermint binary`));
await runCmdUnix('tar', ['-xvf', 'tendermint.tar.gz']);
await runSudoUnix('install', 'tendermint /usr/local/bin');
process.chdir(cwd);
}


function isDockerInstalledDarwin() {
return Boolean(getBinPath('docker'));
}
Expand Down Expand Up @@ -310,7 +314,7 @@ async function setupDarwin(ipcChannel) {
if (!isTendermintInstalledUnix()) {
ipcChannel.send('response', 'Installing Pearl Daemon');
console.log(appendLog('Installing tendermint'));
await installTendermintUnix()
await installTendermintUnix();
}

if (!fs.existsSync(VenvDir)) {
Expand Down Expand Up @@ -364,7 +368,7 @@ async function setupUbuntu(ipcChannel) {
if (!isTendermintInstalledUnix()) {
ipcChannel.send('response', 'Installing Pearl Daemon');
console.log(appendLog('Installing tendermint'));
await installTendermintUnix()
await installTendermintUnix();
}

if (!fs.existsSync(VenvDir)) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@
"start": "electron .",
"build": "rm -rf dist/ && electron-builder build"
},
"version": "0.1.0-rc34"
"version": "0.1.0-rc36"
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "olas-operate-middleware"
version = "0.1.0-rc34"
version = "0.1.0-rc36"
description = ""
authors = ["David Vilela <[email protected]>", "Viraj Patel <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 993499b

Please sign in to comment.