From 28f6c578ecf8f4685071973956d023eeca201d24 Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Thu, 18 Aug 2022 17:04:19 +0100 Subject: [PATCH] Load system-wide zsh files --- roles/home-cli/files/bash_profile | 15 +++++++++++++-- roles/home-cli/files/bashrc | 8 ++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/roles/home-cli/files/bash_profile b/roles/home-cli/files/bash_profile index 0ce5152..6484359 100644 --- a/roles/home-cli/files/bash_profile +++ b/roles/home-cli/files/bash_profile @@ -1,9 +1,20 @@ #!/bin/bash export ACP_BASH_PROFILE=1 -if [ -r /etc/profile ] +if [ -n "$BASH_VERSION" ] then - . /etc/profile + if [ -r /etc/profile ] + then + . /etc/profile + fi +fi + +if [ -n "$ZSH_VERSION" ] +then + if [ -r /etc/zprofile ] + then + . /etc/zprofile + fi fi export BASH_ENV="$HOME/.bashrc" diff --git a/roles/home-cli/files/bashrc b/roles/home-cli/files/bashrc index a5000a7..b0c6f13 100644 --- a/roles/home-cli/files/bashrc +++ b/roles/home-cli/files/bashrc @@ -53,6 +53,14 @@ then fi +if [ -n "$ZSH_VERSION" ] +then + if [ -f /etc/zshrc ] + then + . /etc/zshrc + fi +fi + _acp_add_path () { if ! [[ ":$PATH:" =~ ":$1:" ]] && test -d "$1" then