@@ -6,15 +6,15 @@ const process = require('process');
6
6
const axios = require ( 'axios' ) ;
7
7
const { spawnSync } = require ( 'child_process' ) ;
8
8
const { logger } = require ( './logger' ) ;
9
- const { execSync} = require ( 'child_process' ) ;
9
+ const { execSync } = require ( 'child_process' ) ;
10
10
const { paths } = require ( './constants' ) ;
11
11
const homedir = os . homedir ( ) ;
12
12
/**
13
13
* current version of the pearl release
14
14
* - use "" (nothing as a suffix) for latest release candidate, for example "0.1.0rc26"
15
15
* - use "alpha" for alpha release, for example "0.1.0rc26-alpha"
16
16
*/
17
- const OlasMiddlewareVersion = '0.1.0rc143 ' ;
17
+ const OlasMiddlewareVersion = '0.1.0rc145 ' ;
18
18
19
19
const path = require ( 'path' ) ;
20
20
const { app } = require ( 'electron' ) ;
@@ -55,18 +55,16 @@ const TendermintUrls = {
55
55
} ,
56
56
} ;
57
57
58
-
59
58
function execSyncExitCode ( cmd ) {
60
59
try {
61
60
execSync ( cmd ) ;
62
61
return 0 ;
63
- }
64
- catch ( error ) {
65
- logger . electron ( error . status ) ; // Might be 127 in your example.
62
+ } catch ( error ) {
63
+ logger . electron ( error . status ) ; // Might be 127 in your example.
66
64
logger . electron ( error . message ) ; // Holds the message you typically want.
67
- logger . electron ( error . stderr . toString ( ) ) ; // Holds the stderr output. Use `.toString()`.
68
- logger . electron ( error . stdout . toString ( ) ) ; // Holds the stdout output. Use `.toString()`.
69
- return error . status ;
65
+ logger . electron ( error . stderr . toString ( ) ) ; // Holds the stderr output. Use `.toString()`.
66
+ logger . electron ( error . stdout . toString ( ) ) ; // Holds the stdout output. Use `.toString()`.
67
+ return error . status ;
70
68
}
71
69
}
72
70
@@ -94,7 +92,6 @@ function runCmdUnix(command, options) {
94
92
logger . electron ( `===== stderr ===== \n${ output . stderr } ` ) ;
95
93
}
96
94
97
-
98
95
function runSudoUnix ( command , options ) {
99
96
let bin = getBinPath ( command ) ;
100
97
if ( ! bin ) {
@@ -132,7 +129,7 @@ function isTendermintInstalledUnix() {
132
129
function isTendermintInstalledWindows ( ) {
133
130
return true ;
134
131
//always installed cause bundled in
135
- return execSyncExitCode ( 'tendermint --help' ) === 0 ;
132
+ return execSyncExitCode ( 'tendermint --help' ) === 0 ;
136
133
}
137
134
138
135
async function downloadFile ( url , dest ) {
@@ -171,24 +168,23 @@ async function installTendermintWindows() {
171
168
logger . electron ( `Installing tendermint binary` ) ;
172
169
try {
173
170
execSync ( 'tar -xvf tendermint.tar.gz' ) ;
174
- } catch ( error ) {
175
- logger . electron ( error . status ) ; // Might be 127 in your example.
171
+ } catch ( error ) {
172
+ logger . electron ( error . status ) ; // Might be 127 in your example.
176
173
logger . electron ( error . message ) ; // Holds the message you typically want.
177
- logger . electron ( error . stderr . toString ( ) ) ; // Holds the stderr output. Use `.toString()`.
178
- logger . electron ( error . stdout . toString ( ) ) ; // Holds the stdout output. Use `.toString()`.
174
+ logger . electron ( error . stderr . toString ( ) ) ; // Holds the stderr output. Use `.toString()`.
175
+ logger . electron ( error . stdout . toString ( ) ) ; // Holds the stdout output. Use `.toString()`.
179
176
}
180
177
181
- const bin_dir = homedir + " //AppData//Local//Microsoft//WindowsApps//"
178
+ const bin_dir = homedir + ' //AppData//Local//Microsoft//WindowsApps//' ;
182
179
if ( ! Env . CI ) {
183
180
if ( ! fs . existsSync ( bin_dir ) ) {
184
- fs . mkdirSync ( bin_dir , { recursive : true } ) ;
181
+ fs . mkdirSync ( bin_dir , { recursive : true } ) ;
185
182
}
186
- fs . copyFileSync ( " tendermint.exe" , bin_dir + " tendermint.exe" ) ;
183
+ fs . copyFileSync ( ' tendermint.exe' , bin_dir + ' tendermint.exe' ) ;
187
184
}
188
185
process . chdir ( cwd ) ;
189
186
}
190
187
191
-
192
188
async function installTendermintUnix ( ) {
193
189
logger . electron ( `Installing tendermint for ${ os . platform ( ) } -${ process . arch } ` ) ;
194
190
const cwd = process . cwd ( ) ;
@@ -259,14 +255,14 @@ async function setupUbuntu(ipcChannel) {
259
255
}
260
256
}
261
257
262
-
263
-
264
258
async function setupWindows ( ipcChannel ) {
265
259
logger . electron ( 'Creating required directories' ) ;
266
260
await createDirectory ( `${ paths . dotOperateDirectory } ` ) ;
267
261
await createDirectory ( `${ paths . tempDir } ` ) ;
268
262
269
- logger . electron ( 'Checking tendermint installation: ' + isTendermintInstalledWindows ( ) ) ;
263
+ logger . electron (
264
+ 'Checking tendermint installation: ' + isTendermintInstalledWindows ( ) ,
265
+ ) ;
270
266
if ( ! isTendermintInstalledWindows ( ) ) {
271
267
ipcChannel . send ( 'response' , 'Installing tendermint' ) ;
272
268
logger . electron ( 'Installing tendermint' ) ;
0 commit comments