From 62d6db7ce324b29262eecb772b39a1cc2c8654f6 Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Tue, 23 Aug 2022 13:26:48 +0100 Subject: [PATCH] Fix showing Reading when non-interactive --- roles/home-cli/files/bashrc | 3 +-- roles/home-cli/files/shrc | 2 +- roles/home-cli/files/zshrc | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/roles/home-cli/files/bashrc b/roles/home-cli/files/bashrc index 085a5d7..d08c4fa 100644 --- a/roles/home-cli/files/bashrc +++ b/roles/home-cli/files/bashrc @@ -1,6 +1,7 @@ #!/bin/bash case "$-" in *i*) + echo "[ Reading \"$HOME/.bashrc\" ]" ;; *) # Shell is not interactive. @@ -8,8 +9,6 @@ case "$-" in ;; esac -echo "[ Reading \"$HOME/.bashrc\" ]" - if [ -f /etc/bashrc ] then . /etc/bashrc diff --git a/roles/home-cli/files/shrc b/roles/home-cli/files/shrc index c73a0f9..2908a90 100644 --- a/roles/home-cli/files/shrc +++ b/roles/home-cli/files/shrc @@ -4,10 +4,10 @@ then echo "[ Ignoring \"$HOME/.shrc\" ]" return 1 fi -echo "[ Reading \"$HOME/.shrc\" ]" case "$-" in *i*) + echo "[ Reading \"$HOME/.shrc\" ]" ;; *) # Shell is not interactive. diff --git a/roles/home-cli/files/zshrc b/roles/home-cli/files/zshrc index f75ce2f..0c35fee 100644 --- a/roles/home-cli/files/zshrc +++ b/roles/home-cli/files/zshrc @@ -1,6 +1,7 @@ #!/bin/zsh case "$-" in *i*) + echo "[ Reading \"$HOME/.zshrc\" ]" ;; *) # Shell is not interactive. @@ -8,8 +9,6 @@ case "$-" in ;; esac -echo "[ Reading \"$HOME/.zshrc\" ]" - if [ -f /etc/zshrc ] then . /etc/zshrc