From 422170c2e3acc80a5366659adc209466562ef4bd Mon Sep 17 00:00:00 2001 From: Amaury Hernandez-Aguila Date: Fri, 26 Aug 2022 05:50:16 -0700 Subject: [PATCH] Support for both bash and zsh on macOS. --- src/dashboard/index.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/dashboard/index.ts b/src/dashboard/index.ts index eb05cdc..4cf9c15 100644 --- a/src/dashboard/index.ts +++ b/src/dashboard/index.ts @@ -157,10 +157,11 @@ export default async function () { const getInitFilePath = () => { const home = helpers.getHomePath(); const systemShell = process.env.SHELL || ''; + const plat = helpers.getOS(); switch (true) { case /bash/.test(systemShell): - return path.join(home, '.bashrc'); + return plat === 'macos' ? path.join(home, '.bash_profile') : path.join(home, '.bashrc'); case /zsh/.test(systemShell): return path.join(home, '.zshrc'); case /ksh/.test(systemShell): @@ -206,9 +207,7 @@ export default async function () { } else { cmd = `echo '\nexport PATH=$PATH:${binPath}' >> ${getInitFilePath()}`; } - exec(cmd, () => { - if (plat === 'win') exec('set PATH=C'); - }); + exec(cmd); window?.webContents.send(DashboardChannelsEnum.set_point_path); };