From c3cc13e90508c89238f8676e4201042595e15742 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Thu, 11 Jun 2020 13:45:57 +0200 Subject: [PATCH] local/bin/homeinit: Add safeguard against existing bashrc. --- .local/bin/homeinit | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.local/bin/homeinit b/.local/bin/homeinit index 886dd32b..cb499f0f 100755 --- a/.local/bin/homeinit +++ b/.local/bin/homeinit @@ -208,7 +208,9 @@ else fi pushd ~/dotfiles ## .bash_profile may prevent .profile from being parsed, so we move it. -[ -e ~/.bash_profile ] && mv -v ~/.bash_profile ~/.bash_profile.old +for i in ~/.bash_profile ~/.bashrc; do + [ -e "$i" ] && mv -v "$i" "$i".old +done stow -v . || exit 1 popd @@ -216,10 +218,10 @@ guix_install_profile() { local profile local manifest manifest=$HOME/.package-lists/guix-$i-manifest.scm - if [ -f "$manifest"]; then + if [ -f "$manifest" ]; then warning "Manifest $manifest not found." else - if [ "$i" = "default"]; then + if [ "$i" = "default" ]; then ~/.config/guix/current/bin/guix package --manifest="$manifest" --keep-failed --substitute-urls="$SUBSTITUTE_URLS" . ~/.guix-profile/etc/profile else