Skip to content

Commit

Permalink
chore: Remove unused code and update binary paths
Browse files Browse the repository at this point in the history
  • Loading branch information
truemiller committed Jun 21, 2024
1 parent 322efa2 commit 0c45fb5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
6 changes: 2 additions & 4 deletions electron/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const TempDir = `${OperateDirectory}/temp`;
const VersionFile = `${OperateDirectory}/version.txt`;
const LogFile = `${OperateDirectory}/logs.txt`;
const OperateInstallationLog = `${os.homedir()}/operate.log`;
const OperateCmd = `${process.env.PORTABLE_EXECUTABLE_DIR}./bins/pearl_${process.arch}`;
const Env = {
...process.env,
PATH: `${process.env.PATH}:/opt/homebrew/bin:/usr/local/bin`,
Expand Down Expand Up @@ -354,8 +353,8 @@ async function setupDarwin(ipcChannel) {
appendLog(`Upgrading pearl daemon to ${OlasMiddlewareVersion}`),
);
writeVersion();
removeLogF // reInstallOperatePackageUnix(OperateDirectory);
ile();
removeLogFile();
// reInstallOperatePackageUnix(OperateDirectory);
}
}

Expand Down Expand Up @@ -447,7 +446,6 @@ module.exports = {
startDocker,
setupUbuntu,
OperateDirectory,
OperateCmd,
Env,
appendLog,
dirs: {
Expand Down
23 changes: 10 additions & 13 deletions electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,13 @@ if (!singleInstanceLock) app.quit();
const platform = os.platform();
const isDev = process.env.NODE_ENV === 'development';

const cliPaths = {
prod: {
darwin: {
arm64: 'bins/pearl_arm64',
x64: 'bins/pearl_x64',
}
},
const binaryPaths = {
darwin: {
arm64: 'bins/pearl_arm64',
x64: 'bins/pearl_x64',
},
};

const cliPath = path.join(process.resourcesPath, cliPaths.prod[platform][process.arch.toString()]);

console.log('CLI Path:', cliPath);

let appConfig = {
ports: {
dev: {
Expand Down Expand Up @@ -303,7 +297,10 @@ async function launchDaemon() {

const check = new Promise(function (resolve, _reject) {
operateDaemon = spawn(
cliPath,
path.join(
process.resourcesPath,
binaryPaths.prod[platform][process.arch.toString()],
),
[
'daemon',
`--port=${appConfig.ports.prod.operate}`,
Expand Down Expand Up @@ -652,4 +649,4 @@ ipcMain.handle('save-logs', async (_, data) => {
if (debugDataFilePath) fs.unlinkSync(debugDataFilePath);

return result;
});
});

0 comments on commit 0c45fb5

Please sign in to comment.