From d6dfa7753abfdb23e554b8bd7f7caf065f2376c6 Mon Sep 17 00:00:00 2001 From: David Kebler Date: Thu, 14 Jan 2021 13:55:25 -0800 Subject: [PATCH] add additional ignores for example, template, tmpl extensions refactor shell environment to pick up relative host and network directories via default (common parent with base) --- .bash-shell-ignore | 3 +++ shell.env | 14 +++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.bash-shell-ignore b/.bash-shell-ignore index abd5a1e..a9751fd 100644 --- a/.bash-shell-ignore +++ b/.bash-shell-ignore @@ -2,6 +2,9 @@ # i.e. beginning with . # no ignores here may begin with . *.off +*.example +*.tmpl +*.template *.md *TODO* *.log diff --git a/shell.env b/shell.env index 66850cb..f9a7de2 100644 --- a/shell.env +++ b/shell.env @@ -60,7 +60,14 @@ export NETWORK_DOMAINS=(238.kebler.net 645.kebler.net 3115.kebler.net) # network domain folder entry will be made for each domain set, first is home domain, others via vpn if [[ $NETWORK_DOMAINS ]]; then export NETWORK_HOME=${NETWORK_DOMAINS[0]} -export BASH_SHELL_NETWORK=/opt/bash/shell/network +# TODO needs to be automatically set not hard coded +declare parent +parent=$(dirname $BASH_SHELL_BASE) + +export BASH_SHELL_NETWORK=$([[ -d $parent/network ]] && echo $parent/network || echo /opt/bash/shell/network) +# or comment above and set explictly +# export BASH_SHELL_NETWORK= + declare domain BASH_SHELL_NETWORK_DIRS="" for domain in "${NETWORK_DOMAINS[@]}"; do @@ -70,8 +77,9 @@ fi unset domain export BASH_SHELL_NETWORK_DIRS -# will use $BASH_SHELL_HOST/ unless specifically set -export BASH_SHELL_HOST=/opt/bash/shell/host +export BASH_SHELL_HOST=$([[ -d $parent/host ]] && echo $parent/host || echo /opt/bash/shell/host) +# or comment above and set explictly +# export BASH_SHELL_HOST= # by default SHELL sources will be looked for under $HOME/bash/shell # but can be user set below to $HOME/$BASH_SHELL_USER