mirror of
https://github.com/NixOS/nix
synced 2025-07-01 16:41:47 +02:00
Check shell profile is writeable before modifying
The `set -e` at the top of the script causes the installation to fail to
complete if the shell profile is not writeable. Checking file existence
only is not enough.
(cherry picked from commit ad0dc41899
)
This commit is contained in:
parent
1852f7dbf3
commit
0322c92560
1 changed files with 1 additions and 1 deletions
|
@ -92,7 +92,7 @@ p=$NIX_LINK/etc/profile.d/nix.sh
|
||||||
added=
|
added=
|
||||||
for i in .bash_profile .bash_login .profile; do
|
for i in .bash_profile .bash_login .profile; do
|
||||||
fn="$HOME/$i"
|
fn="$HOME/$i"
|
||||||
if [ -e "$fn" ]; then
|
if [ -w "$fn" ]; then
|
||||||
if ! grep -q "$p" "$fn"; then
|
if ! grep -q "$p" "$fn"; then
|
||||||
echo "modifying $fn..." >&2
|
echo "modifying $fn..." >&2
|
||||||
echo "if [ -e $p ]; then . $p; fi # added by Nix installer" >> $fn
|
echo "if [ -e $p ]; then . $p; fi # added by Nix installer" >> $fn
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue