joshwcomeau / guppy

🐠A friendly application manager and task runner for React.js
ISC License
3.27k stars 154 forks source link

Fix bundled Mac app #291

Closed joshwcomeau closed 5 years ago

joshwcomeau commented 5 years ago

We noticed when using the built application (with Electron Builder), Node wasn't found in the Path on MacOS, on computers that use NVM.

An issue with electron-builder (I think?) meant that the .bashrc file wasn't being sourced when creating new processes with childProcess.

.bashrc is meant to be sourced for shells processes like this - NVM (Node Version Manager) assumes that it will be, and so that's where it adds the path to Node.

This change tries to read .bashrc when the app mounts, which updates the PATH based on stuff in that file.

This is a hacky fix, but to be honest, I just want to get 0.3 out. We can circle back to this and come up with a nicer fix later =)

codecov[bot] commented 5 years ago

Codecov Report

Merging #291 into buildermin-fix-node will decrease coverage by 0.02%. The diff coverage is 20%.

Impacted file tree graph

@@                   Coverage Diff                   @@
##           buildermin-fix-node     #291      +/-   ##
=======================================================
- Coverage                21.07%   21.04%   -0.03%     
=======================================================
  Files                      220      220              
  Lines                     3274     3283       +9     
  Branches                   323      325       +2     
=======================================================
+ Hits                       690      691       +1     
- Misses                    2357     2363       +6     
- Partials                   227      229       +2
Impacted Files Coverage Δ
src/components/App/App.js 0% <0%> (ø) :arrow_up:
src/services/platform.service.js 54.54% <25%> (-18.79%) :arrow_down: