Skip to content

Commit

Permalink
Also append to bash_profile the PATH variable
Browse files Browse the repository at this point in the history
  • Loading branch information
renanccastro committed Sep 21, 2021
1 parent 96d3868 commit 95535dc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
2 changes: 2 additions & 0 deletions npm-packages/meteor-installer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ If you use a node version manager that uses a separate global `node_modules` fol
| 2.3.5 | 2.3.5 |
| 2.3.6 | 2.3.5 |
| 2.3.7 | 2.3.6 |
| 2.4.0 | 2.4 |
| 2.4.1 | 2.4 |

22 changes: 14 additions & 8 deletions npm-packages/meteor-installer/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,20 @@ async function setupExecPath() {
child_process.execSync(`setx path "${meteorPath}/;%path%`);
return;
}
const bashrcFile =
process.env.SHELL && process.env.SHELL.includes('zsh')
? '.zshrc'
: '.bashrc';
await fsPromises.appendFile(
`${rootPath}/${bashrcFile}`,
`export PATH=${meteorPath}:$PATH\n`
);
const appendPathToFile = async (file) => {
return fsPromises.appendFile(
`${rootPath}/${file}`,
`export PATH=${meteorPath}:$PATH\n`
);

}
if(process.env.SHELL && process.env.SHELL.includes('zsh')){
await appendPathToFile('.zshrc');
}else {
await appendPathToFile('.bashrc');
await appendPathToFile('.bash_profile');
}

if (!isRoot()) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion npm-packages/meteor-installer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "meteor",
"version": "2.4.0",
"version": "2.4.1",
"description": "Install Meteor on Windows",
"main": "install.js",
"scripts": {
Expand Down

0 comments on commit 95535dc

Please sign in to comment.