about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Cruice <alex.cruice@gmail.com>2015-05-25T04·49+1000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-02-10T10·57+0100
commitad0dc41899cafb8ee8afc73856d3a86ec3fa0240 (patch)
treee12e2cc430ce1e20219faad3494269d7446351d9
parentc780c1124ec6711f09b9855c3b574b6655af6625 (diff)
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.
-rw-r--r--scripts/install-nix-from-closure.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/install-nix-from-closure.sh b/scripts/install-nix-from-closure.sh
index 3efe7b38435e..465cc1013cc1 100644
--- a/scripts/install-nix-from-closure.sh
+++ b/scripts/install-nix-from-closure.sh
@@ -92,7 +92,7 @@ p=$NIX_LINK/etc/profile.d/nix.sh
 added=
 for i in .bash_profile .bash_login .profile; do
     fn="$HOME/$i"
-    if [ -e "$fn" ]; then
+    if [ -w "$fn" ]; then
         if ! grep -q "$p" "$fn"; then
             echo "modifying $fn..." >&2
             echo "if [ -e $p ]; then . $p; fi # added by Nix installer" >> $fn