Skip to content

Commit

Permalink
fix: write script to temporary file for installing brew
Browse files Browse the repository at this point in the history
  • Loading branch information
angrybayblade committed Jun 5, 2024
1 parent e879153 commit 5f3095e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions electron/install.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Installation helpers.

const nfs = require('node:fs')
const fs = require('fs');
const os = require('os');
const sudo = require('sudo-prompt');
Expand Down Expand Up @@ -115,9 +116,15 @@ function isBrewInstalled() {
}

function installBrew() {
runCmdUnix('bash', [
`${__dirname}/scripts/install_brew.sh`
]);
let script;
if (!Env.CI) {
script = nfs.readFileSync(`${__dirname}/scripts/install_brew.sh`)
} else {
script = fs.readFileSync(`${__dirname}/scripts/install_brew.sh`)
}
const tempfile = `${fs.mkdtempSync("pearl_brew_install")}/install.sh`
fs.writeFileSync(tempfile, script, { "encoding": "utf-8" })
runCmdUnix('bash', [tempfile]);
}

function isTendermintInstalledUnix() {
Expand Down

0 comments on commit 5f3095e

Please sign in to comment.