Skip to content

Commit

Permalink
Support for both bash and zsh on macOS.
Browse files Browse the repository at this point in the history
  • Loading branch information
amherag committed Aug 26, 2022
1 parent 77a6988 commit 422170c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/dashboard/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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);
};
Expand Down

0 comments on commit 422170c

Please sign in to comment.