Skip to content

Commit

Permalink
fix: remove homebrew leftovers from uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
angrybayblade committed Jun 6, 2024
1 parent 3962a76 commit b7bb6c6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions electron/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ async function installBrew() {
runCmdUnix("curl", ["-L", "https://github.com/Homebrew/brew/tarball/master", "--output", outfile])
runCmdUnix("tar", ["-xvf", outfile, "--strip-components", "1", "-C", outdir])

if (fs.existsSync("/opt/homebrew")) {
if (!Env.CI) {
await runSudoUnix("rm", `-rf /opt/homebrew`)
} else {
fs.rmSync("/opt/homebrew")
}
}

console.log(appendLog("Installing homebrew"))
if (!Env.CI) {
await runSudoUnix("mv", `${outdir} /opt/homebrew`)
Expand All @@ -146,7 +154,6 @@ async function installBrew() {
runCmdUnix("chown", ["-R", os.userInfo().username, "/opt/homebrew"])
}
runCmdUnix("brew", ["doctor"])

fs.rmSync(outfile)
}

Expand Down Expand Up @@ -190,7 +197,7 @@ async function installTendermintUnix() {

// TOFIX: Install tendermint in .operate instead of globally
if (!Env.CI) {
if (!fs.existsSync("/usr/local/bin")){
if (!fs.existsSync("/usr/local/bin")) {
await runSudoUnix('mkdir', '/usr/local/bin')
}
await runSudoUnix('install', 'tendermint /usr/local/bin/tendermint');
Expand Down

0 comments on commit b7bb6c6

Please sign in to comment.