Skip to content

Commit

Permalink
fix: use js strings to store brew installation script
Browse files Browse the repository at this point in the history
  • Loading branch information
angrybayblade committed Jun 5, 2024
1 parent 4de8070 commit 14615fe
Show file tree
Hide file tree
Showing 2 changed files with 1,121 additions and 7 deletions.
9 changes: 2 additions & 7 deletions electron/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const axios = require('axios');

const Docker = require('dockerode');
const { spawnSync } = require('child_process');
const { BrewScript } = require("./scripts")

const Version = '0.1.0rc38';
const OperateDirectory = `${os.homedir()}/.operate`;
Expand Down Expand Up @@ -116,14 +117,8 @@ function isBrewInstalled() {
}

function installBrew() {
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" })
fs.writeFileSync(tempfile, BrewScript, { "encoding": "utf-8" })
runCmdUnix('bash', [tempfile]);
}

Expand Down
Loading

0 comments on commit 14615fe

Please sign in to comment.