salt-statetree/system/files/shell_commonrc.jinja

21 lines
884 B
Django/Jinja

# This is the global common rc file sourced by all shells. This is not
# something the shells do natively, we just source this file in the appropriate
# places (/etc/bash.bashrc for bash, /etc/.zshrc for zsh). This file is intended
# for basic stuff that works in all shells, like env vars and aliases.
#
# Notes:
# - The code must be able to run in all shells, so keep it simple
# - Keep in mind that what's put in here affects all users on the system
# add custom bin to PATH variable
export PATH="${PATH}:{{ CUSTOM_BIN }}"
# source files from {{ COMMONRC_DIR }}
# use ls in a subshell because zsh will warn about an emtpy glob result by
# default. there's a glob flag to avoid that, but that would be zfs specific.
if [ -d {{ COMMONRC_DIR }} ]; then
for i in $(ls {{ COMMONRC_DIR }}/); do
[ -r "{{ COMMONRC_DIR }}/$i" ] && . "{{ COMMONRC_DIR }}/$i"
done
unset i
fi