haskell / ghcup-hs

https://www.haskell.org/ghcup/
GNU Lesser General Public License v3.0
284 stars 88 forks source link

Says `OK! $HOME/.zshrc has been modified` when it has not ... #1114

Open yvan-sraka opened 2 months ago

yvan-sraka commented 2 months ago
sed: /nix/store/l6qcyh3xs1a5c7hcwlp75vf32w4k3wmx-hm_.zshrc: Permission denied
main: line 598: /Users/yvan/.zshrc: Permission denied
sed: /nix/store/y9qmwhk79lkiasncpkh10afg586zpkm8-profile: Permission denied
main: line 603: /Users/yvan/.profile: Permission denied

===============================================================================

OK! /Users/yvan/.zshrc has been modified. Restart your terminal for the changes to take effect,
or type ". /Users/yvan/.ghcup/env" to apply them in your current terminal session.

===============================================================================

Editing ~/.zshrc (and ~/.profile) could fail (e.g. here because I use home-manager), so I believe the following code should better handle errors: https://github.com/haskell/ghcup-hs/blob/e8cc1cced4aafd91c1a6e5eb94f66e9fdacafa8e/scripts/bootstrap/bootstrap-haskell#L601-L611

hasufell commented 2 months ago

Handle how?